I would go with a G19. If I had to do it all over again I would pick a G19 over my G23. The .40 is a super snappy caliber making quick follow up shots more difficult than the 9mm. The grip angle on a Glock creates less muzzle flip compared to others firearms, this allows the shooter to control their shot placement easier. Comparing my Sig P6 to my G23 with a 9mm conversion barrel one can really tell the difference in muzzle flip between the two.
Personally, I like the G23 due to the flexability of the platform. With a few extra parts, i can shoot 9mm, .40 (stock) and .357 SIG.
However, if this is your first (from what I recall of intro post), I would personally go to a local store or range where you can rent the 2 and try them side by side.
You'll be qualifying with the pistol so it's important that you're comfortable enough with it and that you can practice enough with it. Some folks really do not like the "snappy" nature of the recoil of the .40 round and this affects how much you practice and your confidence.
The ammo cost between the .40 and the 9mm can be pretty significant when you start getting into consistent shooting sessions.
My vote would be neither, cuz I couldn't choose which one I wanted between 26/27 so I bought both and love both equally BUT!! I still wasn't satisfied so I bought a G30sf and I'm overly joyed and I feel complete.. All glocks are good but G30 is just so perfect
G19 would be a good first choice. I got mine a Gen 3 a month ago. I have been to the range and shot 300 rounds. I feel more confident every time shoot. The recoil softens somewhat and make aiming easier for the next shot. I have the Ghost 3.5 trigger kit which has made trigger pull smooth. You can customize your model Glock to you.