I have a Sig p229. I love it. My dad has a sig sp2022 he loves it. One is all metal, one is polymer both shoot great and carry well.
Both can be found in .40cal.
You might also look at the p239 also available in .40cal
I had a friend who bought a H&K .40cal and then sold it off for a 9mm. It was just to expensive to shoot enough to get good with.
Go to a range where why you can rent guns to try and shoot everything you can get your hands on.
no ranges or places to rent, then just start hitting the stores and trying out as many as you can to see which one feels the best in your hand. the one that feels the best is the one you are likely to hit accurately with.
go with the 9mm. cheaper by a long shot in regards to ammo cost. if you don't reload or can afford the ammo you will never be good shooting the 40. i own a 40, but it gets shot way less than the others right now until i get my reloading dies in for it.
Glock 22 Xdm 40 or Ruger Sr20. All compact size with descent capacity. They all include trigger safeties ideal for carrying, although the Ruger and Springfield have additional safety features like Ruger: manual safety and Xdm: grip safety. Ruger would be your lowest priced at right around 400 and a hundred bucks more would get you the Glock or Springfield.
Like many others, 40sw takes a back seat to 9mm and 45acp for me as well. But if you're looking for a great 40sw, Bud's has the two-tone Sig P226 for $669. It's gonna be really tough to beat that gun at that price.
Most of the $400+ polymer options are also excellent guns.