I've come accross some information that might be answering this question. I am posting the info for those who might be interested.
Some fella claims, in a post to another forum, to have measured the case support on several guns including a Glock 22 (40 s&w). He measured the distance from the base of the case to the furthest point, toward the mouth of the case, which is not supported. The longest unsupported length can be found at the bottom of the chamber where the feed ramp ends. He found that on a standard Glock 22 full case support starts at 0.235 and onward. Because these measurements don't mean much by themselves, he sectioned various 40 s&w brass to measure the case "web" and found brass which has a web area that only extends 0.180 from the base of the case.
This leaves the Glock 22 with a -0.055 deficit when it comes to case support

, which might explain why these guns go KB! with such consistent frequency. As an interesting side-note, the 10mm Glock 20 has a case support defficiency of 0.070, even more than the 40 s&w which has a lower pressure rating.
Based on this info, which is yet to be independently verified, I would reason that the absolute fail safe minimum chamber length is, for starters, dictated by the case webbing , as such it should be 0.670, arrived at by subtracting the 0.180 webbing from the 0.850 case length. Any headspacing gap has to be added to this value as well, so if you had a 0.010 headspace your min. chamber length would have to be 0.680 as the case might get pushed towards the breach-face, effectively exposing more case area beyond the case web.
Based on this I would also never buy a glock in the 40s&w or 10mm caliber as these guns have a design flaw, period!

. Now if you are stuck with a Glock and you reload, you can virtually eliminate your headspace by varrying the OAL of your ammo, but this approach guarantees an even higher case support deficit as a longer OAL will push the case base towards the breach face. minimal or 0 headspace in a Glock, as a matter of proper fitting, would seem pretty important as the gun is operating with a significant case support deficiency, which will lead to KB! with reloaded brass or "hot" loads.
Now I was curious if a 1911 outfitted for 40s&w is any better than the Glock. I made some measurements, and can say that the barrel I have provides full case support (assuming the 0.180 webbing) with a +0.020 margin into the case web area, although with these values I would not want my headspace to exceed 0.020

. The case support could be further improved by using a ramped barrel and/or reducing head-space to near 0 in a properly fitted frame-slide-barrel.
Any of this makes sense?
P.S. I am editing this because I was in error not to recognize Louis earlier when he did correctly imply headspace being a factor. Thanks Louis.