Thanks for the response, you list some good things to consider. A micro controller may work better, but I've never done one of those myself. I had always assumed that people had issues because I've not seen a method to use them with the 49ways. I have a set of the GPwiz49 but they only register in Windows, so I am out of luck if I want to use my Linux OS.
IIRC, the 49 ways have 3 optical switches each direction, which are logically combined into 8 active joystick circuits on a 12 pin header. Roughly 4 buttons on CP per player means controller would need 16 inputs and PiZero GPIO has ~26 (
https://www.raspberrypi.org/documentation/usage/gpio/).
My presumption is that a wrapper program could translate inputs for Mame, and a script in Mame could auto-select game mode for joystick mapping.
EDIT: updated circuit numbers above.