1. Any ATmega32U4 development board. Most commonly sold as "Arduino Pro Micro". Developing a keyboard emulator in the Arduino IDE is pretty easy; if you don't want to do that, LUFA is a great little USB stack.
2. Raspberry Pi Pico. Newer, so it's less well documented, but much more powerful.
Yes, Arduino, Raspberry Pi, and ESP8266 are the best "cheap MCUs" for personal use, quick shipping, good documentation, for a one-off USB keyboard.
For the RPi Pico specifically, the TinyUSB driver is the way to go. This also supports USB host (plugging a keyboard into the Pico), but that didn't support the mouse scrollwheel when I tried.
If you're interested in larger-scale manufacturing, and are willing to invest more time and effort in once-off R&D to reduce the per-unit cost, then there's a lot more options of other MCUs (e.g. PIC, Cypress, STM32).
Mitch Davis gave a great talk at the Embedded Online Conference this year (which my wonderful manager assigned us time to watch during working hours!), where he bridges the gap between hobbyist Arduino development and professional Embedded engineering. (It's closer than you might think)
Miro Samek also has a great series of lectures (which I learned about in the same Embedded Online Conference), which then levels up from an Arduino-style "superloop" to an RTOS, Active Object design pattern, and beyond.
Welcome to embedded development, I hope you enjoy creating new gadgets, and don't forget to share your adventures with the community so we can encourage you along!
Slightly tangential, but I recently wanted a mechanical keyboard converter dongle with QMK.. the pro micro was there only viable option due to supported stacks.
I made such a thing using a board called "Teensy LC." I'm a long time user of Teensy boards for prototyping in an R&D environment, and the LC is the cheapest. My interest was just PgUp and PgDn buttons for a foot pedal page turner.
In addition, I programmed an ESP32 board to do the same thing, but as a Bluetooth keyboard. Both the Teensy and ESP32 can be programmed via the Arduino development environment.
Now there's cheap and there's cheap. The stuff I use is cheap in terms of, it won't break the bank for a R&D or hobby project. Then there's cheap in terms of wringing cost out of a commercial product, which I know little to nothing about.
> Then there's cheap in terms of wringing cost out of a commercial product
This is a very astute distinction that hobbyists wanting to go from Arduino to production often miss.
I went from the basically cost-unconstrained world of Medical Devices to wearable consumer sensors (e.g., heart rate monitors, etc.) and it was a bit of a shock to see just how much impact cost had. I mean, you know that in a "theoretical" sense, but it's completely different when you are dealing with it on a daily basis.
Thank you for commenting to ask your question, Hacker News does have many skilled people around from a variety of backgrounds including embedded systems! So your question is related.
The Edit feature is also very useful, and I often go back to add more details, like you added the (~$1) afterwards. In future, please can you write "Edit" when doing that? It appears that duskwuff has been downvoted, because they assumed that "cheap" meant for a personal hobbyist level, not a professional mass-produced level, and now their comment makes less sense because Arduino & RPi are more expensive than $1. Please do continue to use the Edit feature, it's cleaner than writing a new comment! Just please keep in mind how that affects others.
As for me, I use Arduino, RPi, and ESP8266 for personal use, and NXP i.MX RT1050 chips at work, all of which are outside the price range, so there's not much more I can say. I imagine that the chip shortage is raising many prices these days though.
2. Raspberry Pi Pico. Newer, so it's less well documented, but much more powerful.