M&P 2.0 vs XD-M (10mm)

Planning on doing more hiking this year in bear country and I’ve been wanting to purchase my first 10mm

Between the two, which would you choose and why? Also open to other options, I like that both of these come optics ready. Leaning more towards compacts so I can conceal carry if I want. I’m also considering a Glock 29

Planning on doing more hiking this year in bear country and I’ve been wanting to purchase my first 10mm

Between the two, which would you choose and why? Also open to other options, I like that both of these come optics ready. Leaning more towards compacts so I can conceal carry if I want. I’m also considering a Glock 29