This view is just very extreme, it is much less zig zag. It is just mounted to the wall at the high points and slack in between. Certainly there is also a reason for the exact amount of slack like thermal expansion.
* The amount pictured is in excess of that required for thermal expansion. The excess is to have some spare length in case of modifications. For example if you have to replace the transformer and the terminals are not in the same location. You cannot extend a massive cable like that easily or without degrading its specs.
* The sine wave pattern makes it into AC of course (/s)
What's the zig-zag pattern for, seems like a fair bit of extra conductor.