Since your question did not take into account ammo cost, I would say that the .40SW is the obvious choice.
This round is entirely adequate for CCW, as evidenced by its use by so many law enforcement agencies.
In IDPA, it will work in both SSP and ESP classes.
For USPSA, it will work in a Production gun (although scored minor), as well as in Limited and Limited 10. Some have set up .40SW guns for use as Open guns also, but they are hardly carry guns.
However, if you only want to shoot USPSA Production as well as IDPA SSP and ESP, then 9mm would be the choice