Do you have a lathe? Grind a HSS tool to match the profile and hold it in a boring bar. With the sprocket held in the chuck (not spinning), advance the cutter through the bore with the carriage feed. Dial in a few thousandths more on the cross slide and take another cut. Do this over and over until you are at full depth.
The trick now is to index the sprocket for the next spline. If you have an exposed back gear, and the tooth count is a multiple of 16, you can rig up a stop pin to hold the spindle in each position. Another method is to bolt a gear or sprocket to the back side of the spindle and direct index off of that. If you have a dividing head, then rig that up to the spindle and you can do any spline you can imagine.
You wouldn't use this method for production, but for one-off stuff it'll be a lot cheaper and faster than farming it out.