Is there any way to exit a car underwater?

Yes, that’s tempered glass. Grab a handfull of paper and push it up or down (carefull of your eyes, tempered or not) and it will crumble to pea-size. You can still get minor nicks from it, but you almost need to work at it.

I’ve replaced quite a few broken sunroofs and always chipped away as much glass as I could beforehand and I don’t think I remember any that were clean enough that I’d want to crawl through. Here’s another good image, the center would come out, but those edges aren’t going anywhere. You could chip it down a little if you can hold your breath for a while, but I’d take a side window any day.

If your electric windows don’t work, then your electric sunroof won’t work either. Which means it comes down to breaking one or the other. Probably easier to swing at a window next to you than at a sunroof above you.

moreover, many cars don’t have sunroofs.

1987 was the first year Honda’s Acura line was fully deployed in the US (they came with factory manuals for the mechanics who would have never seen one before).
The way they dealt with “can’t open doors, power windows dead, need to get out” was hilarious- 7" long crank with a 1/4" square drive - to open the sunroof.
I never even tried to open it with that toy, but I’d assume you’d need to be large and strong.

I kept a crowbar behind the driver’s seat - has many uses.

Yes, you need a sharp impact tool for the glass. The side and rear windows in a car, and any sun/moon roof are made out of tempered glass. Tempered glass is up to 7 times stronger than regular glass and you can spend your last few minutes banging away at it and not break it. You can almost hit it with a baseball bat and not break it. But the skin is very sensitive. When I worked at a glass shop we had to be very careful with the tempered glass items because if the area you set the edge down on had even a little sharp rock, you could destroy the whole piece.

When thinking about tempered glass you should imagine that the outside skin of the glass has been shrunk and is holding the inside of the glass under great pressure while the hardened skin keeps the glass strong. That isn’t the most scientific explanation, but it is an accurate description of how it works. You need a sharp object to puncture the skin of the glass and release the pressure and everything will crumble easily.

I have one of those spring loaded punch tools in my console, I probably won’t be able to find it after a crash when I am upside down in the water, but I could also use it if I came across another car in the water and help someone out.

Forget banging on the windows with your fists, you are not strong enough. And the front windshield has a plastic barrier in the middle of it, so unless you can kick the whole windshield out of the frame, don’t waste your time trying to get out that way.

The union at my wife’s place of employment gave out a free tool, it has a sharp punch for the tempered glass and a razor slot for cutting off a seatbelt. Everyone should have something like that in their car.

Obligatory XKCD.

If you don’t have one of those lil hammer things, pull out the headrest and use the pointy pins on the bottomo