A few comments.
I wouldn't underestimate the cost to bring up a non-M up to M specs. Suspension main components, all the bushings, rear diff. It adds up quick. To bring up an E82 or E92 up to E46 M specs is something like $3k or more just in control arms and bushings. For a 6MT E82, a Quaife LSD will set you back at least $2500 net. Getting room for tire on a non-M could be challenging as well. $2-3k for the EA front fenders plus paint, probably another $1-2k.
You can certainly make a more powerful car for less money with a N54/N55 engine that a naturally aspirated M3 (I6 or V8). A tune and downpipes on an N54/N55 will put you close to a V8 M3 power level, but with a lot more torque. Full bolt ons (intercooler, full exhaust, intake) and you're talking more power. It will be difficult (read: expensive) to tune up a naturally aspirated car. Header, exhaust, intake, and tune will yield FAR less gains.
As others have said, the M package is a nice overall balanced package of handling and power. If you don't care as much about modding, it's not a bad idea.
I had looked at the E46 M3 when I was in the process of looking at the E82 135i. I decided I liked the tuning potential of the N54 engine. The E46 M with more miles would have been slightly cheaper than my 1 year old 135i. The E92 M3 was still too expensive at the time, and I preferred a smaller, lighter car for autocross. Ultimately the E46 would have been the best autocross car, but I like to tinker, so the 135i was my decision.
2009 BMW 135i, 6 MT, M Sport, DIY DCI, Cobb AP, Apex 18x8.5+9.5, 235/265 Starspecs