canada
If your friend has not guilty of an offence, it is not because of consent. Consent is vitiated when the accused intends and causes serious bodily harm to the other (R. v. Paice, 2005 SCC 22 at para. 18).
However, the defence of necessity may be available, although the Supreme Court has never directly decided this issue. See R. v. Latimer, 2001 SCC 1 at para. 40 (also surveying the law in other jurisdictions):
The third requirement for the necessity defence is proportionality; it requires the trial judge to consider, as a question of law rather than fact, whether the harm avoided was proportionate to the harm inflicted. It is difficult, at the conceptual level, to imagine a circumstance in which the proportionality requirement could be met for a homicide. We leave open, if and until it arises, the question of whether the proportionality requirement could be met in a homicide situation. In England, the defence of necessity is probably not available for homicide: R. v. Howe, [1987] 1 A.C. 417 (H.L.), at pp. 453 and 429; J. Smith, Smith & Hogan: Criminal Law (9th ed. 1999), at pp. 249-51. The famous case of R. v. Dudley and Stephens (1884), 14 Q.B.D. 273, involving cannibalism on the high seas, is often cited as establishing the unavailability of the defence of necessity for homicide, although the case is not conclusive: see R. Card, Card Cross and Jones: Criminal Law (12th ed. 1992), at p. 532; Smith & Hogan: Criminal Law, supra, at pp. 249 and 251. The Law Reform Commission of Canada has suggested the defence should not be available for a person who intentionally kills or seriously harms another person: Report on Recodifying Criminal Law (1987), at p. 36. American jurisdictions are divided on this question, with a number of them denying the necessity defence for murder: P. H. Robinson, Criminal Law Defenses (1984), vol. 2, at pp. 63-65; see also United States v. Holmes, 26 F. Cas. 360 (C.C.E.D. Pa. 1842) (No. 15,383). The American Model Penal Code proposes that the defence of necessity would be available for homicide: American Law Institute, Model Penal Code and Commentaries (1985), Part I, vol. 2, at § 3.02, pp. 14-15; see also W. R. LaFave and A. W. Scott, Jr., Substantive Criminal Law (1986), vol. 1, at p. 634.