If you’re surrounded with people jumping on your car, trying to break in and throwing items, I would posit that punching it would clearly be self-defense.
My father did exactly that back in the 60’s in DC, surrounded by a mob of obamabi’s boys and he hit the gas (what little there was. . .a VW Beetle), and knocked the beejeesus out of the mob and they parted like the Red Sea after a few bounced on the pavement and one got run over.
That was pretty much my point. I call it "urban street bowling."