Zagg sells a hinged keyboard that works with 7 inch tablets. I bought one alongside an Amazon Fire 7 inch during a black friday sale. Thought it would be fun to have a mini laptop for around $50. The two worked well in conjunction. Was even almost pocketable. But the Fire was slow. If someone spent all their time in Termux, the Fire might have been fast enough.
It's a pity the 7 inch Windows tablets didn't sell well and have largely vanished from the market. One could install Linux on them, and use them with something like the Zagg keyboard.
I guess there's one more possible option. Boox's eink tablets have support for BT keyboards. Pair the 8 inch model with one of the hinged keyboards. As long as the screen can keep up with the typing (I have no idea) that might work well.