To a certain extent, the best gun is ultimately the one the shooter shoots the best.
Let's look at the worst case scenario: something from the Al-Quaida training tapes. Four opponents armed with AK-47's and grenates, with the attackers forming back-to-back pairs. Not a situation any sane person would want to enter with a handgun and alone, but still worth examining to see what will enable one to best survive it.
Clearly the problem here is that you have to neutralize 4 opponents before they figure out who is shooting at them and start shooting at you. Assume that whatever gun is chosen the shooter immediately heads for whatever cover is available, and that the attackers are distracted by the 50-100 other people in the immediate area - which is quite realistic. So, if you place your first 2 shots well, you have two opponents hit and hopefully down before the others realize what is happening.
The best chance of surviving is to minimize the amount of time required to neutralize each opponent. You need fast, accurate, disabling hits. Ideally you want a 1-shot stop, although I realize that such things are not easy to achieve with any handgun. So, you want the most accurate and hardest hitting handgun you can have, so you can make each shot count for its maximum potential. If the fight is still going on when you have reached round 10 or 12, you are in deep doo doo if not already dead. I'd want the .45 1911 instead of the 17+1 Glock because it gives me the best chance of ending the fight with 4 shots.
Consider another situation: you have time for 1 shot before your attacker reaches your wife with a knife. What do you want that one shot to be?
Consider the situation of a soldier in Afghanistan or Iraq, who has to carry maybe 80-100 lb. of gear and needs to maximize the amount of ammo while minimizing total weight. He may be quite some distance from being able to be resupplied. Now, the 17+1 shot 9mm makes a lot of sense.
Consider my wife. She is a novice shooter who is becoming less recoil-sensitive and muzzle-flash sensitive, but it is still an issue. She shoots well with big, heavy .38 spl. and 9mm guns, and shoots my 1911 with less complaints than she does most 9mm's, but she does her best shooting with a big, heavy Beretta 9mm or K-frame S&W. I'd rather see her place a 9mm or .38 in center mass than see her make peripheral hits with a .45. The 9mm makes sense.
Consider concealed carry. A 1911 with thin grips is a very easy to conceal gun, even in full-size configuration. Same with the magazines. However, a Glock 17 is only 1/10 inch thicker (and is actually thinner if standard grips are used on the 1911), and 17+1 rounds basically eliminates the need to carry spare ammo. A 9mm can always be made smaller than an equivalent .45. The 9mm makes sense.