Far less faff to buy a cheap commuter, plus it means you can run full guards and the gearing will be more appropriate. And your mtb will be ready to ride all the time and not wrecked by the winter weather.
The answer is always another bike 😆
Actually, being serious, when you are commuting, you want reliability, speed of access and sometimes a turn of speed. A second bike dedicated to this purpose makes a lot of sense. You’ll also want permanent lights and a rack and mudguards.
Well, I bought my hardtail as a commuter bike, but I also like to ride it offroad sometimes 😉
Finding a set of reasonably priced wheels that accommodate a 20mm front hub is proving problematic (thank you Shimano for your new 15mm standard) so a dedicated commuting bike may well be the best bet…