Its very easy to make MTBs fit due to the number of different stems available, add a long seatpost and you have a lightweight chuckable trail machine.
I very rarely see advice from you that I disagree with LGF, but I have to disagree here. Steering characteristics are very sensitive to stem length, so I would suggest that stem length should never be used to make a bike fit. And especially a longer stem should never be used to make a frame that is too small 'fit'. I wouldn't want a bike that 'fits' if the downside was that it had unresponsive steering.
If the OP is looking to advise a friend whose leg length is slightly short in relation to his height, that argues for a larger size frame with a sloping top tube. He must have a long upper body in relation to his legs, so a larger frame would give him a long top tube to suit his long upper body. He could set the seat lower for his shortish legs and a sloping top tube would prevent the standover being too high.