let me make it worse<g>
i own two hk45 compacts. *and* let me say, i don't think i have never fired a glock (perhaps my first range visits when i rented everything under the sun).
here are my thoughts, fwiw:
1. i am *very* comfortable carrying the hk decocked and locked and at this stage would be comfortable carrying it cocked and lock in single action mode. they are as reliable as bricks and as military weapons, what they essentially are, they will, i am confident, work after being dragged thru the mud.
nobody can dispute glock quality, but in your case (hiking and such), i think HK gives you an edge.
2. i don't like weapons without safeties depending upon how i have to carry it and in what. although it is not a great idea, i would put a decocked and locked HK in, say, a fanny pack with other things whereas no way would i do that with a glock.
3. IMO, hi-cap mags mean nothing for self defense. the first two shots do, and if you need more than that it will mean you are in huge trouble and likely a total statistical oddity.
4. accuracy for self defense at more than, say 15-20' means that you are probably firing in a situation that may very well get you sent to prison, never mind perhaps shooting when it is not necessary. if the gun does well at 7 yards, you have a winner.
and *both* guns will do that well.
and let me make your choice even worse<g>.
i think, given the slight difference in size from the 40 to the 45, and insofar as nothing replaces mass for extra oomph when shot placement is right (i'm sure this will start an ammo war..that is not my goal), why not go for the 45...3.58" barrel and when properly held, at least in my hands, the da trigger is not a stopper (pun intended<g>) at all...although i suspect the glock is a bit easier to shoot and i believe the profile of glocks to be slightly better for self-defense shooting.
worst case, have $80 worth of trigger work/polishing and it will be even better (i have not found the need to do that yet).
i cannot help it...my total faith in hk quality and the liklihood that their guns will still be shooting in even the worst conditions, make me a believer....at least enough to have two of them.
anyway, good luck with whatever you do.