The 351M, 400M, and 351C are part of the same engine family (335 Cleveland series).
The 351M is a destroked 400M. You can tell them apart (M & C) by the raised area where the upper hose goes into the timing cover, it's an inch or so taller. These are pretty big engine themselves, compared to a Windsor. Those are considered mid-blocks, they're not technically big blocks, though the majority of the M engines are big block bellhousing and motor mount set up (there are some exceptions though, I think some 400s were small block bell). Some parts interchange between the 351C and 351/400M. There's not a lot of difference between the 351M and 400M, they're the same block. The intakes are dry, there's no coolant than runs through the intake. They are REALLY expensive to build, but in stock form they are turds (M). They can make power, but at a high cost, and it would be better to make it a 400M.
I've pulled one of those engines out of a F150, like I said, they are big bastards.
The 302 & 351W are both Windsor blocks, small block bell and mounts. They have nothing in common with the M engines. Ideally, a Windsor would probably be the most simplistic and practical for a Ranger swap. But that's just my opinion.
Pete