The M's have a taller deck height and were installed more in big passinger cars. One easy way to tell the difference is the surface for the t-stat is raised on the M's. I think that know body ever made headers to bolt one in a mustang. Actually they're good engines and are based on the 351c 2V heads. The 400 is very popular, well at least for it's crank in the 408 windsor.
351M and 400 were derived from the 351C, but with higher deck and 429/460 bolt pattern. 351M and 400 engines never got better than 8:1 ratio pistons and two-barrel carb. Not totally sure but I believe that their heads are Cleveland type. However, they have 10.3 or something deck height vs 9.5 of W and 9.2 of C so they are heavier. Hot Rod did a low-buck rebuild of 400. Performer intake is available, a set of 9.45:1 pistons and Comp Cams 268 Extreme Energy cam were used in HR article and they pumped out 382 hp and over 400lbs torque. Maybe still not the performance engine of choice but certainly no a boat anchor after such rebuild. I know one guy who built 400 and put it in 71 or 72 FB and nick-named it Boss400.
See the following site also http://www.projectbronco.com/Technical_Articles/351m400_performance_build_up.htm