musko rounded me up.....
G'day Beman, I know *for sure* that electric welding a vehicle without disconnecting the battery will fry an alternator, and but I haven't done a generator but expect would be the same- not hard, simply remove the battery cables....
I can't say about the magneto, but would at least remove the plug leads, and the carbon 'earth' brush(s) which may or not be necessary- the guru's will be able to confirm that....
Re the peg/spline, 'what the others have said', but if you weld it is another one probably wrecked forever, original ones must be coming to short supply and can't guarantee the quality of pattern ones so tread with care