I’ve thought about it too, and I have some ideas, but no real way to test any of them.
I’m a plant breeder. I have a bean variety that’s everbearing. Where most beans stop producing if the pods get too ripe, this one just keeps pumping them out. Let them ripen to where the pods start to change color, but haven’t started to dry, for maximum protein with minimal mess.
(Dry pods would shatter and become a safety hazard in zero-G.)
As an added bonus, this variety doesn’t cause nearly as much gas as most beans, and they taste more like beef than beans.
Another breeder I know works with air potatoes. These have a similar food-value as regular potatoes, but the spuds form all along the vines. I’m pretty sure that would give you more productivity in a small space, and you wouldn’t need to worry about the spuds being exposed to light. The lines he’s breeding don’t turn toxic no matter how much light they get.
Combine beans with potatoes, and you get a complete protein.
There’s more. I used to fill entire notebooks with ideas for self-sufficient space colonies. But life happened, and I don’t even know if I still have those anymore.