Seems like a lot of work, but if you have the time to try it, people have spent more time on more trivial things.
Might be something to think about if it was a no longer available part for an older saw.
Some of the sprocket portions may be cast; some may be made from sintered metal. So play with some scrap ones that you don’t care about before trying it on one you do.
And let us know!
Philbert
There are 4 Stihl dealers within an hour's drive and the one I shop at sold me a new spur sprocket and the caged roller bearing for my MS170 for the equivalent of US $ 40. Yep, there are cheaper aftermarket items available but probably made of cheese - I prefer to buy genuine.
So, below there's a pic of the worn one, and many would say it's got more work left but a lifetime of mucking around with motorcycles has taught me not to put a new chain on worn sprockets, and my hand filed chain was cactus.
I arc/stick welded it up with some 2.5mm 6013 which is the smallest I had in the shed, then ground it down with a burr in the Dremel. Pic two.
The welding distorted the bore a little so it needed a bit of honing and I mounted the sprocket with the old caged bearing, did a tank of firewood cutting with a new chain.
Inspecting the repaired sprocket after cutting and it was evident my hand grinding was a bit rough and ready in that a couple of the teeth's renewed surfaces had a bit more wear than the others.
All in all it was a worthwhile exercise. Next time it will be welded with a harder rod material (maybe ask a mate who can Mig/Tig, whatever) and ground down with a more accurate indexing method to get all six teeth equal.