I'll preface this with - I usually disconnect the battery for just about any work I do, not just welding.... Just a habbit.....
However I question the old wives tale of the Battery needing to be disconnected before welding - if proper common-sense practice is followed.
Do you disconnect the ECU or other modules before you weld? Well these are probably at more risk.
ALWAYS connect the earth as close as possible to the weld area for a few reasons - battery, bearings, seals (remember it gots hottest between the weld & earth), modules etc. Also specifically you must earth the item you are welding, not something nearby. (Just to state the obvious)
Pay specific attention to ensuring you have good earth.
If welding anywhere near electronics I would suggest pulling all the main fuses - just cause it's quick and a lot cheaper than new modules