Shouldn't be a major issue, can't think why you'd want to take the engine out, just take an angle grinder to the weld, change the sprocket and weld new nut on.It was the solution I resorted to before Yamaha recognised there was a problem and came up with a deeper nut. I changed the C&S twice more after the first welded-on nut.
Just a thought, would welding the sprocket and retaining nut onto the driven shaft from the gear box cause the welded parts to lose its tempering and soften the steel?There is a problem when welding on cars, so assume it is the same with motorcycles, with the alternator/generator, the voltage from electric welding can fry them, I believe the alternator should be removed from a car before welding , don't know if the same rule applies to the on-board computer, might be wise to ask the question of someone who really knows before going ahead, cos, you just might make your situation worse.
I'm still on the original 9mm nut after 75k miles. If the shaft isn't undersize and nut torqued correctly, under or over tightening both bringing problems the original nut seems to hold ok and there are still a lot of them out there. But plan to swap it for the 12mm one next time the chain is replaced since the new nut only a fiver
i dont expect it to loosen off with it being torqued to 320 nm