I own 5 pistols chambered in .40 S&W. I've carried a couple more issued ones.
Having been trained as an armorer for Glock, SIG (Classic models), S&W ("3rd Gen" & M&P) and S&W/Walther (SW99/P99's), I have some preferences I indulge when it comes to what I own and use.
If I were going to start over with my own buying/using, I'd get something from Glock, S&W or SIG and call it a day.
Ergonomically, it's really hard to beat the M&P 40. The new model 2.0 has some refinements and design enhancements which are nice, but the original M&P has been revised and refined over the last 10 years and is a serviceable pistol. (Kind of like how Glock makes both the Gen4 and the previous "Gen3", S&W is making the new 2.0 and the standard M&P.)
The Classic P226/229's are serviceable guns, and can be obtained in both the original TDA (Traditional Double Action, also often called DA/SA), as well as their Enhanced DAO (also called DAK). I tend to prefer the TDA, myself, but I'm a longtime 1911 and DA revolver shooter, so I acclimated to TDA pretty easily ... and it probably helped that I carried TDA duty weapons for many years.
The new SIG P320 is going to become better known now that it's been adopted as the new Army pistol, but I've not attended the 320 armorer class, so I'm unfamiliar with it from an armorer's perspective. One of the armorers at my former agency is planning to attend the class, so I'll probably hear more after he comes back from it. I've only seen one fellow carrying one as an authorized personally-owned duty weapon (9mm, I believe), and he seems content with it thus far.
The Glock Gen4 & "Gen3" guns have certainly established themselves. The first of the Gen4 guns to be designed was the G22, and the double sprung RSA in that .40 model has been welcomed by many shooters who feel it gives them a better degree of recoil management over the single spring RSA used in the older G22's/.23's. The only Glock .40 I personally
own is an earlier G27 (E-series production), as it fits my hand better than the standard & compact models, but that's just
me.
While I've invested some decent range time with other gun company .40's (Beretta, HK & Springfield's XD), I've not completed armorer classes for them, either, so I don't have any experience regarding them as an armorer (although, I've met some armorers for Beretta and HK, and have listened to their experiences and opinions).
Bottom line? There are some pretty good quality, serviceable duty-type .40's on the today's market which are going to provide some decent service for their owners and issued users.
Find some to try and see which ones suit your preferences better, and decide for yourself.
"Best" is something that always going to be debatable and arguable. What's the "best" car, truck, boot, computer, TV, watch, phone, etc? Try some different ones find what
you like, for the reasons which matter to
you ... and don't be surprised if you change your mind from one time to another.