You could just look at the script – it attempts to download an official release archive and extract it. There’s no filtering of paths in the 7za command: https://github.com/fstarred/mame-scripts/blob/main/getmame.bat#L21

I’m a bit more uncomfortable about the script for downloading ROMs from mamedev.org without showing the user the “for personal use only” notice.