I realize that when you short the terminals of a motor, it stops the motor faster than just turning off the voltage.
I was wondering if putting a large diode across the leads so that when the motor is running current can't flow through the diode, but when the current stops, the diode would short the pins. In other words, connect the positive (anode) side of the diode to the negative pin of the motor and the negative (cathode) side of the diode to the positive side.
Would this have the same effect as shorting the leads of the motor?
A typical DC motor may be reasonably well modeled as an ideal motor in series with a certain amount of inductance and resistance. An ideal motor will always have voltage across its leads proportional to rotational speed, and current flowing through it proportional to torque. If a motor with frictionless bearings and 2.4-ohm internal resistance would have a no-load speed of 1200rpm at 12 volts, then such a motor rotated at 1200rpm would generate 12 volts. If the leads are shorted, such a motor would have 5 amps flowing through it, and would generate 5 amps' worth of torque.
As a pretty good approximation, shorting a motor which is spinning at a certain speed will generate braking torque pretty close to what would be obtained by driving a stalled motor with the same voltage as the spinning motor would generate open-circuit.