There's a spectrum of mountain bikes.
You are likely shopping on the cheap end and that's a good place for your stated purpose. Just make sure you have a freehub not a freewheel, which usually means 8 speed not 7 speed in the rear.
if you want to upgrade from there, bikepacking or traditional touring rigs are extremely versatile.
A "real" trail bike with air fork and air shock on a complex rear suspension and a dropper seatpost is excellent at steep climbs and fast descents and you should definitely try one, they are fun as heck. But they're not great commuters.
__________________
Genesis 49:16-17
"Well, well!" said Holmes, impatiently. "A good cyclist does not need a high road. The moor is intersected with paths and the moon is at the full."