You don't have to be near the battery for the gas to ignite. Although hydrogen is lighter than air (see the Hindenburg airship.) I think disconnecting the battery is a good idea. I've seen reasoning that goes like: Battery is +12v. You're messing with the ground level when you're welding on it and potentially raising that +12v to +12v + welding voltage of whatever (18, etc.) potentially apply 20-30+v to whatever components are live. They may or may not be able to handle that.
I've seen a lot of muffler shops welding with a MIG and have never seen one pull a battery cable. If they had a lot of problems buying new ECU's, I'd think they'd be pulling battery cables.
Safest, of course, is to physcially remove all the electrical components and put them in a grounded Faraday cage while your working on the vehicle. This may not be practical.