9mm vs .357 magnum:
9mm 124 grn GDHP +p out of Glock 26 = 1200 fps
.357 mag 125 grn Federal Hi-Shok out of 2.25" SP101 = 1200 fps
The .357 magnum is so versitile though. It can shoot the pipsqueek 148 grn wadcutters and the 180 grn hunting loads.
But for defense against humans? The 9mm makes sense.
40 cal? The 40 cal is more powerful than the 45 acp in alot of loadings. But, the .40 cal guns can be made to have a more manageable grip with high capacity. The XD-45 opened up a new can of worms
If your looking ofr a true self defense gun, with knock down power, and combat accuracy? The .40 cal wins the power race. But, you can't stop what you don't hit. The 40 cal can be a handful (so-to-speak)