If you are on a budget you could get a 2nd hand one, if you can’t find a YZ one, get anyone that is longer & same diameter. Cut/drill the old one out (after measuring it) & reweld it making sure the weld is not going to obstruct anything. Grind the end to the same measurement as it rubs against the case to stop it moving right.
Chances are the gear lever will damage the good splines if you reuse it.
Get a big Haddock or other suitable local fish & slap the person who said to weld it. Tell him that’s from the next owner of the bike. :thud: