They are mechanic cars. Anything over 5 years old is a ticking time bomb. M car maintenance is usually in the thousands of dollars and a replacement motor will run 10k.
If you were dead set on the bmw, any non turbo charged inline 6 is a good start.