The XD, Glock 27, Kahr: all are solid reliable guns with good reputations. Each weapons system has subtle differences in operation, action, malfunction clearing drills, grip angle, ergonomics, etc. The differences don't necessarily make one better than the other, they are just different.
What it comes down to is what gun is best for you. The best thing would be to get to a large gun store and see which model fits your hand best and what feels most comfortable. Better yet, find a range that would let you rent different models so you find out which you shoot best.
Also consider how you might be carrying the weapon. The The kahr will be slightly more comfortable for Inside the Waistband carry than the wider XD or Glock.
You will be able to find replacement parts more easily for the Glock than the other two models (which you are unlikely to need anyway), but may not like its grip angle. However that is less of an issue with the G27 since the shorter grip on the sub-compact mitigates that somewhat. I learned to shoot pistol with a Glock so the angle doesn't bother me in the least.
As to other options, CZ makes a .40 S&W version of its sub-compact RAMI. Sig's subcompact model is the P239. Beretta's equivalent is the PX4 Storm compact. H&K also issues a P7 in .40 S&W although they are hard to find.