There are two schools of thought about the electrical connections. One is that the battery damps stray electrical impulses to protect the electric devices. The other is that the battery provides a stable reference so any electrical spikes present maximum differential to any devices in the path between source and reference.
A diode doesn't care if both its connection rise to whatever voltage. It is the differential voltage across it's leads that can kill them if the difference exceeds ratings.
Welding on the frame components, shifts the electrical potential of the frame. Where the grounds connect, and the arrangement of devices on the bike determines the electrical stresses placed upon them. Disconnecting the battery allows devices to "ride the wave" as it were. However, if the welding currents don't use a path near the devices, the differential is not presented to them.
If you watched the show where Ewan McGregor rode new BMW's around the world, you remember they dumped the bike a broke a part off it, the local welder, welded it back on, and the bike wouldn't run anymore as the electronics were fried by the welder current.
Cheers,