From my perspective (older, lots of eyesight correction, multiuser considerations - - - hunting, self defense, carrying, etc.), these thoughts:
If you're going to add a red dot, consider one of the newer closed emitter ones. A drop of rain on an open emitter (RMR/SRO/DeltaPoint/etc), and you're out of business. (With my eyes, I've used dots for years. Love 'em, even with the issues they sometimes present (well documented, but, for the better dots, becoming less frequent)
The longer sight radius of the G40 is a non-issue if using a dot. Thus the G40 just becomes larger and heavier.
The G29, or at least some of them for some people, have experienced feeding issues with some loads. Experimenting with different weight recoil springs can usually address the issue, but it's one not typically seen in the G20 or G40.
The G20 SEEMS to not have these issues, other than needing milling for a red dot. Which, to me, is worth the time/cost.
Or . . . compare the ballistics of .40 and 10mm in pistol-length barrels.