I currently own one of each, but mine aren't directly comparable as the G23 is a Gen3 RTF2 model.
Either is a fine choice; really, it just boils down to what caliber you prefer. Here are the stats:
Fifteen slightly-less-powerful 9mm caliber shots, or thirteen slightly-more-powerful .40 caliber shots.
The .40 weighs more (empty or loaded), but not by much.
9mm will bounce a bit less during firing.
.40 ammo is about 25%-35% more expensive (comparable loads).
Practice being important for building skill, and cheap practice ammo being better than expensive practice ammo (more bangs per buck), I'd say unless you have a need or strong want for the .40, go with the 9mm.