well in my opinion its a good reliable caliber the best out of the three options for price punch and availability as well as reloading components are much easier to find. its also very easy to find a gun in that caliober for a good price with the style you desire there is many many more options for a 40 than there is a 357 magnum and 9mm handguns are going to be twice if not three times more expensive because they're mass produced by many companies and much more upgraded and complex
you are right , you can get used 40s for dirt cheap
it doesn't cost a dime more to make a 9mm gun than it does a 40 , there is just less demand and an over stock of excess 40s
so lets say you get a LE trade in 40 Glock 22 for 272.00 and a similar G17 for $349 yes the G17 is harder to find sold out a lot more often.
https://officerstore.com/firearms/used-firearms?_bc_fsnf=1&brand=441&stock_status=In+Stockfor a few reasons , the market is flooded with cheaper 40s , first departments get 1/2 the life out of them , now cops really don't shoot their guns all that often but they might go 1500 rounds a year and can expect to have to re-spring at 4500 rounds that is also a good time to put new pins in them. basically have the armorer sit down and go through them for wear
armorer time is more expensive than parts.
likewise 9000 rounds if a good time to go through your G17 for more than cleaning time for springs and a wear check.
so you went 3 years or 6 years
when you go 3 years it becomes an administrative choice to send back your guns for trade in get the credit and discount and get all new 40s
the same for the 9s but half as often.
just like you don't have them overhaul your patrol vehicle you order new ones and send the old ones to the auction. It is a fixed expense budget item.
now we go hit midway for a little ammo shopping you buy 9mm for 26-28 cents a round we will average that at 27 cents a round and 40 starts at 38-40 cents a round so 12 cent a round difference on average.
now I want a good carry ammo so I for sake of this argument and good availability chose Hornady critical duty it is available in both 9 and 40
9mm critical duty is 1.37 a round
40S&W Critical duty is 1.67 a round
so you buy your 272 dollar gun and fire 250 rounds of practice ammo through it then 50 of your defensive ammo , now you are ready to carry
G22 40 cal $272
250 rounds @ 39 cents a round = $97.50
100 rounds of SD ammo @1.67 a round $167.00
536.50
G17 9mm $349
250 rounds @ 27 cents a round = $67.50
100 rounds of SD ammo @ 1.37 a round 137.00
553.50
I agree in the first purchase and getting ready to carry , the 40 is 17 dollars cheaper and that will almost pay for your first recoil spring they run 20 dollars and the 40 uses 2 of them for every 1 the 9 does
but they both go between 12 and 16 inches in 10% ballistics gel
now if you intend to do what a vast majority of people do , buy a gun and toss it in the drawer for some day with a few boxes of ammo you will see a much greater savings
on the other hand if you shoot 1500 rounds a year to maintain a level of proficiency and buy 100 new rounds of SD ammo each year
9mm will cost you 542 dollars a year
40 will cost you 752 dollars a year and a recoil spring and whatever else you break.
I didn't even get into how the 40 is shown harder for a majority of officers complete the course of fire for annual recertification.