I haven't driven the Cobra, but I can honestly say that it is one of the only three Fords I actually have any respect for at all. Of course it's not my style personally. The engine is a superb engine, as is evidenced by the fact that it is used in the F150 Lightning and the upcoming Ford GT. However, my appreciation for the base Cobra stops there. It still has typically ford handling dynamics, not really all that loose, but also not very tight either. The steering is very VERY slow, the shifter is downright shitty, and the interior looks like a regurgitated pleather couch. The Cobra R is a much much better car, with actual racecar quality driving dynamics (enough so that it can match a lotus elise sport 190 on a road circut, something no other production ford can claim) I believe one magazine called the SVT Cobra R "the single best handling freight train [they] had ever driven" It goes without saying that any current production model non M BMW would have a hard time keeping up with an SVT.
The ///M3 and ///M5 are another story. While the SVT Cobra trumps the ///M3 for torque, it only has a mere 17bhp advantage over the ///M3. The 0-60 times are equivalent, as are the 1/4 miles and the ///M3 enjoys a much much better roadholding ability. The ///M5 is a bit slower but is still a contender in terms of speed. You really can't draw a parallel between the ///M5 and the Cobra because they are a different class of car. But if it were up to me, I'd take the ///M5's 5.0L V8 over any Ford V8 any day of the week.