This comparison would have been far more interesting if the M3 wasn't on 12 year old Conti sport contacts 1's-- comparable in grip to a modern snow tire (perhaps worse, as they're undoubtedly dried out at this point).
The S54 was a modified S50B32, which was a modified S50B30, which was based on the design principles of the M50. It's hardly a "modified M50".
The McLaren F1 uses S50B30 heads/cams/vanos/pistons/rods, so the S54 is more closely related to the McLaren F1 engine than it is the M50. In fact, it uses improved versions of McLaren F1 parts
. To this day it makes more Tq/liter than any NA engine other than the Ferrari 458 speciale, and has higher piston speeds than any other engine I know of (higher than any F1 car). It also develops the highest specific output of any BMW normally aspirated street engine, ever (including S65 and S85, and McLaren F1).
Run of the mill tractor engine it ain't.