What about a diode that would connect the two poles of the motor together when it's moving backward and not do anything when it's forward?
Like.. put the anode on the end where the 12V is applied and the cathode on the end where the GND is. That would reverse the diode when power was applied, but when the power was shut off and the motor started generating power, it would go through the diode and act as a brake.
Now if we build our own diodes out of some sort of electromagnet, is it legal?
