Be really careful guys, if you ever see your temp gauge move at all, stop immediately, especially on an E46 with that moronic buffered gauge. Don't let it go anywhere near red.
My old 535i overheated on me once, rapidly climbed to three quarters (in about thirty seconds) and I turned it off. Three weeks later we discovered blown head gasket :*( Now the old bitch is sitting in pieces in my yard. I'm morbidly afraid of that gauge now.
This is a good time to do a complete cooling overhaul (assuming it hasn't already been done?). Five hundred bucks to do everything except the radiator (which lasts ages). It should be done anytime from 80,000km/6yrs onwards anyway.
I did mine at 160,000km/8yrs and everything was leaking/failing/stuffed except the water pump which someone had already replaced.
Reading the codes is an awesome idea, that might indicate some sort of electrical issue with the temperature sensor or fan issue, though I believe you have a mechanical fan on the M3? I've got a Peake Reader if you wanted to try that, though a proper laptop set-up is probably easier to decipher.
How long ago was the coolant changed? The suggestion that an air lock popped up in the wrong place is the most likely possibility so far. They'll cause sudden rapid overheating and then disappear leaving you wondering what happened.