I purchased my '03 M5 in October 2005, with 6800km on it. I sold it this past summer with about 37,000km on it (I don't drive much). Luckily it still had 2 years of the warranty on it when I got it.
During that time, the lower oil pan leaked (replaced under warranty), the radio occasionally forgot what preset it was on (replaced under warranty), one of the rear brake light sockets was making intermittent contact with the bulb (easy fix), starter motor needed to be replaced, new battery needed, lower oil pan started leaking (again), some dead pixels on the instrument panel display (very common problem), and some of the buttons on the climate control panel started falling off.
Also, the car is rather sensitive to the state of the cats. When I replaced the stock muffler with Tubis, I occasionally would get cat efficiency codes. Didn't affect performance, but still annoying. There are workarounds for these codes. I did not suffer from the carbon fouling of the secondary air system, which is another common problem with these cars.
If, knowing what I do now, I had to do it all over again, I would still buy the car. It is a fantastic car to drive. The problems were nothing major, mainly annoyances. However, having now owned a BMW, it has kind of cured me of wanting another, especially with their current lineup.