Rather than grind a whole flat edge on your shaft tighten down your set screw then undo remove pinion and do a small grind right on the mark you just made.
If you are not going to grind here is a trick I use use blue locktight tighten down setsrew loosen a turn then retighten the first tightening makes a mark the second tighten lets it bite into the make and then it wont slip.
Of course without seeing your setup it is hard to figure, but is there room for you to flip the pinion the other way, and will it still mesh with the spur gear?? I have seen that on some setups.