I have had gone through 4 e39 m5's before and is currently driving a 07 335i sedan. Let me just say it is a luck thing with German cars. They do require a bit more maintenance, and parts can be a bit more expensive when things goes wrong. Out of the 4 m5's that i have owned, 2 gave me tremendous amount of trouble. Electricals, sensors, semi-catasprohic engine failures, lights that never wanted to work, and the list goes on and on. However, on the other two my family and I literally drove the crap out of it expecting the same issues, but nothing.
On the 335i that I dd right now with various basic mods (jb4, intake, charge pipe, exhaust etc) pushing 400hp out of the 3.0L, it has not given me any problems at all as well. The only maintenance that is a bit bothersome is weared control arm bushings prematurely, (at around 30k miles). I swapped in M3 control arms for that (bushings cannot be replaced individually due to design), as well as a failed floor board control unit (one that controls most electricals, replacement costed around $1k).
You can try Subaru if you like what they have to offer. Or spend a little bit more and take a gamble on a german vehicle. If this is your first euro car, maybe get used cause they have already depreciated much. Sell it if it gets too troublesome. A very awesome vehicle will be the e90 335i with the jb4 flash mod and m3 suspension swap. Drives like a dream and eats other cars alive on the streets. Good Luck!