As far as I know there's a limit of 2 action buttons and 4 directional buttons while mapping two gamepads in DOSBox. In games such as Tyrian 2000 and Micro Machines 2, it would be beneficial to have the option to exceed these limits; Tyrian 2000 has I believe 3 action buttons (the optimal way of playing is with one keyboard and one gamepad), and Micro Machines 2 can support up to 4 players at once. Having 4 players at once on a tiny keyboard does not exactly sound comfortable.
Maybe there could be a way to map all the buttons on maybe 4 different controllers, without "telling" DOSBox, in other words some sort of gamepad-layer on top of DOSBox itself? DOSBox would then think no gamepads are connected at the DOS-core level, while in reality there's a layer/wrapper on top of DOSBox that does not carry over the old MS-DOS limit in terms on maximum number of gamepads/buttons on the gamepads itself. The gamepad layer/wrapper translates in real time which keyboard key should be pressed according to the connected gamepads, so the core of DOSBox only registers the keyboard presses the layer/wrapper sends over.
I believe the libretro core of DOSBox SVN has that functionality to some degree, as RetroArch translates all the key-commands to the keyboard itself.