You are correct. The leakage is considerable. That is one of the reasons why handguns are generally not very powerful or accurate. The other problem is that the barrel is simply not long enough to give the explosion time to speed the bullet up. The barrel needs to be at least 16 inches long. Most of the energy that the charge generates simply goes out the end of the barrel after the bullet has departed.
So what is the solution? Faster burning powder and more of it : ) At some point the losses don't matter.
Hmmm. I liked the "speed of sound" explanation.
I guess this has to be settled by looking at the muzzle velocities for revolvers vs. pistols.
I believe that muzzle velocities for rifles are, as you indicate, much higher than those for short-barreled weapons.
This was probably true in the early years of mass production handguns. Things like revolver forcing cones, double action and other technological advances have largely solved these issues.
I killed an Elk with a 44 magnum handgun in 1983. We got nearly 1100 pounds of cookable meat off that bad boy. I made that shot with a (IIRC) 240gr FMJ slug at approx 30 meters. Heavy brush in Washington State. Ruger Super Blackhawk with a 7.5 inch barrel. One shot right thru the shoulder/heart lungs. Dropped right where he took it. I always felt it was a nice easy (technically speaking) shot.