Electric motor shafts are generally a quite readily weldable low carbon steel. A small diameter shaft like that is going to get pretty hot, and will more or less temper itself, if it ever had a trace of hardness due to the welding.
We've built up and welded new stubs on literally hundreds if not thousands of motor (and other) shafts over many years. We always preheat any heavy section, as it is important to avoid that initial 'hard pass' which results from putting a small joiner bead on two cold pieces of iron. This is because the weld is usually done in a two sided Vee, and the first pass most often looks okay, but the second pass (when you roll it over to the other Vee) is what can crack the first pass. Then, you're welding over top of a crack when you roll it back over for the third pass and that is bad news to incorporate a crack in the middle of your weld, particularly if that crack reaches to the surface.
So the preheat is something that a good welder will take advantage of, if he is trying to produce a reliable repair. Use of a plain steel filler rod that is similar in strength to the parent material is a good method. Don't use high alloy rods, as these can produce unintentional hardening because of mixing in the weld puddle and along the edge of the Heat Affected Zone. Generally the weld quality metal is better than the parent anyway, if you can apply proper welding technique and produce 'honest welds' that are as good as they look.
BTW, pressing the motor shaft out, making a new one can be a good method......to try your patience
Hint: the shaft only comes out one way. Push it backwards, it will stick, seize and score, at which time you will then have to drill it out. Installing a new shaft with a press will likely bend the new slender shaft as well, so a heat shrink is advisable. It only requires maybe a .001" interference in the rotor, so you don't have to go crazy with the heat, but you do need accuracy to ensure that the fit is an honest one, and not just tight in one or two of the laminations.