If you buy an M&P .40, you can buy M&P 9mm mags (20-25$) and an M&P 9 barrel (50-75$) and they will drop right in and work in the .40 frame/slide.
You can use the .40 to meet major power factor in USPSA, and switch to 9 for IDPA for SSP.
Or you could just buy the 9, and shoot SSP in IDPA and production in USPSA
Or you could buy the .45 and shoot limited 10 (i think) in USPSA and cdp/ssp in IDPA.
Personally, I would get the 9. The .45 is sub-optimal for any class in IDPA.
I might be rusty on some of the rules, I think my post is correct though!