I have used several 9mm's for range work and competed in local BE shoots with a couple.
Had the M&P 9, and found that the Apex sear did not improve the trigger enough. Also, there was some speculation that the locking lug on it needed some redesign in order to improve accuracy. Went into this one thinking it would be amazing, was very disappointed.
Had a top end STI Duty One 9mm 1911. Great gun. Accurate...expensive. Found that the internals were not really as in spec as a .45 acp 1911, for some reason and could not put in the C&S kit I wanted, to get the trigger pull I wanted. Sold out of frustration.
Glock. Had a 17, tricked it out, rear dove tail mini red dot, it was too easy to shoot accurately, almost boring.
Glock 19, have to say, surprised me and become one of my most favorite guns. The reason to get a Glock is that you can change EVERYTHING about it and make it whatever you want. I put in a new trigger and springs, got the pull to 2lb. Bought a LW match barrel and Carver compensator. It was a Gen 4, so changed out the grips until I found what I liked most. Then, topped it off with adjustable target sights. This gun was terrific and very inexpensive to create. I won a local BE shoot with it. The reason I went with a G19 rather than back to the 17, was that I liked the balance of the 19 better, and, with the extended, adjustable rear sight I installed, the sight radius was about that of the 17. So....went with the 19 and really liked it.
If you are between the 17 and 34, I would just get the 17 and go to The Glock Store, LW or Glockmeister and replace the trigger system, springs, sights, barrel etc.
SIG 226. My absolute favorite 9mm. A little research showed me that a stock 226 will shoot almost ....almost ...as well as their top of the line X5. I bought a match barrel and had a local smith...who knew what he was doing, do a trigger job on this. Then, again, topped it with adjustable target sights. New grip. Tried different brands of ammo. And won again.
So...after 3 pages of this thread...I must confess, I am not sure what you are looking for. If you want a range gun that you can really use to achieve your personal best...and you DO want to mod the gun, then the Glock is your best choice. If you have the money and want an out of the box competition gun, you can spring for a SIG X5. For less, you can get the 226, if you can find a local smith who really knows what he or she is doing.
Both the G19 and SIG 226 are excellent for HD since they are both high capacity and have a rail for a weapon light.
Not sure how much you can mod the other choices that have been recommended. If your goal is to get better, you will need to have a gun you can mod. I surmise that most shooters can achieve their personal best with any new gun, out of the box, fairly quickly. To go farther, you need to be able to mod the gun.
Hope this helps
Best
J