The correct way to do it would be to Rc snubber it.
The R calc'd in such a way that it pulls the average current the motor pulls if it were connected direct to the supply, and the C calc'd so that it holds enough energy to empty that in the inductance of the motor.
So at switch off the current drops back to zero failry smoothly, instead of making a huge voltage spike.
I have seen and used a common technique and thats solder a 100n across the motor terminals, and from each terminal to the case of the motor.
If its a fairly beefy motor from a drill you might need class x caps to take the beating.
The R calc'd in such a way that it pulls the average current the motor pulls if it were connected direct to the supply, and the C calc'd so that it holds enough energy to empty that in the inductance of the motor.
So at switch off the current drops back to zero failry smoothly, instead of making a huge voltage spike.
I have seen and used a common technique and thats solder a 100n across the motor terminals, and from each terminal to the case of the motor.
If its a fairly beefy motor from a drill you might need class x caps to take the beating.