My understanding is that the most likely cause of a pistol malfunction is a magazine issue. That information could be wrong, but that’s why I carry a spare. Extra rounds are great, but probably not too likely to be needed in a self defense situation. Having a spare in case a malfunction arises is probably a more likely scenario.
To answer the OP, my thought is to shoot until empty or the threat stops in a self defense scenario. I would like to know the statistics of how often someone shoots through a modern high capacity magazine and needs the additional rounds. Now, if you’re still living in the land before television was invented and still carry a 1911, that may be a different story. Sorry, CM.
In addition to malfunctions, consider that it's not uncommon for magazines to become unseated, even when holstered. If that happens and is not noticed before the gun is needed, drawing and presenting will make a 17+1 shooter into a 1 shooter. If you're moving when this happens as you should be, recovering the only magazine you have from the ground could be problematic if someone is trying to harm you. Better have a plan B.
"But that never happens to me!" Until it does.