Suppose I get involved in an accident, but the other driver appears to be such a maniac that I have reason to suspect that any further interaction with the driver will result in me being seriously injured or killed. Am I legally allowed to leave the scene?
Colorado law provides for a general justification of "choice of evils". CRS 18-1-702:
(1) Unless inconsistent with other provisions of sections 18-1-703 to 18-1-707, defining justifiable use of physical force, or with some other provision of law, conduct which would otherwise constitute an offense is justifiable and not criminal when it is necessary as an emergency measure to avoid an imminent public or private injury which is about to occur by reason of a situation occasioned or developed through no conduct of the actor, and which is of sufficient gravity that, according to ordinary standards of intelligence and morality, the desirability and urgency of avoiding the injury clearly outweigh the desirability of avoiding the injury sought to be prevented by the statute defining the offense in issue.
So if you weigh the "evils" of (a) not providing your information to the other driver, versus (b) being seriously injured or killed by them, it would seem clear by "ordinary intelligence and morality" that the desirability of avoiding (b) outweighs the desirability of avoiding (a). Therefore, although leaving the scene would violate 42-4-1601 as in user6726's answer, under these circumstances, doing so is justifiable and not criminal.
Per 18-1-710, justification is an affirmative defense under 18-1-407. If tried for a violation of 42-4-1601, you would need to "present some credible evidence" of the justification. It would then be up to the state to prove beyond a reasonable doubt that your justification was invalid; if they cannot, you should be acquitted.
There is perhaps a question about "a situation occasioned or developed through no conduct of the actor". If your driving was partly the cause of the accident, and it was the accident that triggered the other driver's murderous rage, then taken literally this justification might not apply. Still, I would think there ought to be some "reasonably foreseeable" standard; having someone try to murder you is not a reasonably foreseeable consequence of bad driving. It may also be a consideration that the other driver's conduct is itself unlawful. Perhaps there is case law on this question; I haven't searched carefully.
There is a law in Colorado requiring you to "remain", §42-4-1601, that anyone
directly involved in an accident resulting in injury to, serious bodily injury to, or death of any person shall immediately stop such vehicle at the scene of such accident or as close to the scene as possible or shall immediately return to the scene of the accident. The driver shall then remain at the scene of the accident until the driver has fulfilled the requirements of section 42-4-1603 (1)
Being imaginative, the driver of the other vehicle might be unharmed but enraged, and a passenger might be seriously injured. You have to satisfy §42-4-1603 (1):
The driver of any vehicle involved in an accident resulting in injury to, serious bodily injury to, or death of any person or damage to any vehicle which is driven or attended by any person shall give the driver's name, the driver's address, and the registration number of the vehicle he or she is driving and shall upon request exhibit his or her driver's license to the person struck or the driver or occupant of or person attending any vehicle collided with and where practical shall render to any person injured in such accident reasonable assistance, including the carrying, or the making of arrangements for the carrying, of such person to a physician, surgeon, or hospital for medical or surgical treatment if it is apparent that such treatment is necessary or if the carrying is requested by the injured person.
You cannot use a belief that the driver plans to beat you as a reason to not provide the required information (the law does not disallow document-and-dash), but at any rate, under 1601(1.5)
It shall not be an offense under this section if a driver, after fulfilling the requirements of subsection (1) of this section and of section 42-4-1603 (1), leaves the scene of the accident for the purpose of reporting the accident in accordance with the provisions of sections 42-4-1603 (2) and 42-4-1606.
Under the circumstances, it may not be practical for you to remain and provide medical assistance, assuming that your assessment of the driver's rage is objectively reasonable.