If you buy the handloading software program Quickload, it will calculate the velocity of different barrel lengths.
I have put a lot of effort into making a more powerful carry handgun.
The length of the barrel does not matter.
Certainly 40sw vs 10mm does not matter, even though 40sw is CAPABLE of more with it's small primer pocket.
The first limitation is case support.
With an aftermarket barrel with a feed ramp no deeper than the case web is thick, case support is no longer the problem.
The problem is then recoil.
About half the momentum from the projectile and and gas goes into the slide motion relative to the frame. The other half moves the frame and arm. If the recoil spring is not high enough force to store that much energy, then the slide hammers the frame. A little is ok, but a lot is not.
If I put in springs with such high force that I am the only man I know with the grip required to chamber a round, I can still handload 10mm, 40sw, 45acp, 9x19mm or even 380 too hot for those springs. The cases fly a long way and the slide hammer the frame. That is not good for the gun OR my hand.
Here is a plot I made [with a Wagner force gauge and an X-Y mill table] of my highly modified 1911 recoil spring [and hammer spring sometimes].