The factory 9mm barrel actually works better than the aftermarket barrels do.
Anything you do will void the factory warranty. Polishing the trigger, filing the burr off the takedown lever, and yes, swapping out the barrel.
Hundreds, maybe thousands of M&P 40's are using M&P 9mm barrels, with hundreds of thousands of rounds fired with no problems.
As Nike says.... Just Do It!!!
.