In that situation, I’d have no problem mashing the gas pedal.
You actually have a legal right to flee if your life is reasonably threatened.
You also can leave the scene of an accident and drive to the nearest police station and not get charged for hit and run.
White guy in black neighborhood accidentally hit a black kid on a bike a year or so ago. He (white guy driver) stopped and was beaten into a coma by the crowd that gathered.
Me either. I've got a nice big "protester" grill guard on my 3/4 ton pickup.