My favorite .40S&W, I'd have to think about that...
The first I shot was a .40S&W SIG P239 (I was shooting my S&W 65LS and a cop in the next stall at the range was shooting his off duty P239, he had never shot a .357mag and I had never shot .40 or a SIG so we shot about half a box of ammo from the other person's gun). It was a sweet shooter and I fell in love with the thing, and it performed like a full sized gun. But, back then, a SIG was well out of my budget (the metal framed SIGs are still a bit tough on a teacher salary). Later, well... There are much smaller guns with similar 9mm or .40S&W capacity, and most guns that size have much greater capacity, so it didn't make any rational sense (but I still want one and probably will eventually buy one).
My first .40 was a CZ 40B. I hadn't yet warmed to the caliber, and I didn't expect to own very many guns, so I sold it to make room for something else (I constantly kick myself over that decision). Not sure where it would land on the list. I love CZs, and have good memories of the gun, but didn't keep it long enough to really know.
The one I had/have had the longest is my Taurus PT140 Millennium Pro. However, it hasn't worked for several years and definitely isn't my favorite (though it was the first that I really liked, as I had it once I started to like the caliber).
I really like my S&W M&P40c. Great platform, shoots like a bigger/full sized gun, holds 10 rounds in a flush mag and 15 in an extended mag, and it is quite accurate and reliable.
Though, I think my favorite is the SIG P229. I had one some years ago, but unfortunately had to sell it when I needed the money more than I needed the gun. It was an absolute dream: comfortable to shoot all day, no bobbles ever, very accurate, and very well built. I missed it for years, until last Spring I finally replaced it with a fairly beat up used 229 I found at a great price.