Here is the thread I had when I installed headers on my Z4MC a while back.
There is tons of space on the Z4M for this switch, but patience helps. And I did not have to get euro cats nor did I get an ECU tune - simply relocated my post cat O2 sensors post the second set of cats (under the car) and the EGT to before them. No CELs and readiness codes are set and the car made 17 whp on the dyno that can be felt on daily driving (more low end and mid range torque) as well as on the track.
Euro headers w/relocated sensors|RPI scoop|K&N panel filter|KW V3s|OEM Strut Brace|RE RSMs|Zeckhausen CDV|SpeedBleeders|Stoptech Brake Lines|StopTech 4-pot BBK all around|SSR GT2-H 19x8.5/19x10|Potenza RE-11s
Texas Mile (March, 2010): 155.4 mph