I thought my Glock 23 was inaccurate too until I watched a DFW Police Officer make smiley faces with it at ten yards. After his counsel, my groups tightened up. I chose the 23 to avoid the high cap rat race. Even with the infringement mags, I have 11 rounds of great stopping power in a good package from a platform that is more than accurate at accepted self-defense ranges.
Marshall and Sanow recently did a study that points out the .40 has a slight edge over the .357 Sig in terms of penetration and expansion on ACTUAL SHOOTINGS, not goats or jello.
As to comparing the .40 and the 9mm, there is no comparison. If there was, there wouldn't be the mass exodus from the 9mm in the LEO community. Remember, we are talking LEO/Self Defense applications here not Military usage.