If you are purchasing for SHTF, or fun, you should buy the G23 in .40 and then get the 9mm conversion parts and mags. In fact, any handgun that will accept these conversions should be purchased in .40, even if you don't plan to shoot it.
Because in a SHTF scenario you have no idea what ammo will be available to you. Sure you may have a stockpile of 9mm but what if you are forced to grab your hanguns and vacate immediately, without time to retrieve and carry your immense stockpile?
What then if all the 9mm in your area is soaked up and you only have access to .40? With the Glock, you can buy it in .40, and get the barrels for .357 sig AND 9mm, keep it all in the same case, and when the SHTF you can grab that case knowing that you will have three different ammo choices based on availability.
some of the less-common rounds like .40 and .357sig may be easier to come by at that point. You never know. So if you're TRULY considering SHTF, think past the situation that exists today, when there is no S and no Fans.