I would try using a Forming Tap/Roll Tap or a Thread Mill in this application.
I would not attempt making my own pinion, I leave it to the people that specialize in gear cutting or hobbing.
If you have access to the specialized equipment and the time to learn the manufacturing procedures it could be interesting to you.