Nice welding.A good long soaking in penetrating oil, eg PlusGas, might help too.
If you do find your mast is corroded at the bottom (although yours looks much better than mine did), you can have a reinforcing sleeve welded onto the outside. You can just see the top of it in this picture, level with the top of the teak chocks:
View attachment 168184
You just want to renew the wiring. Can't you do it without disturbing the mast foot? From the picture this seems to be still in acceptable conditions. If it not broke....
To me it looks like 2 wires coming out of the mast just under the rigging.Maybe I'm missing something - but I cannot see any wiring .... ???