Indirectly, it's already there.
romlister has a rom scan utility in which it will take your complete merged xml file and truncate it down to just the roms that exist on your hard drive. after doing that, you will have an xml file that contains all the information about all the roms on your drive. Then, you could do a "list all roms" and output that list as a CSV file, in which you export out the controls, number of buttons, etc and then sort that list to know what the maximums are.
clumsy for sure, but already in your hands.