I've photographed a lot of cars over the years and eventually developed a rule:
If I'm getting out of a car and shutting the door without the keys in my hand, I put down at least one window. This actually comes up a lot because with car photography I often want the parking lights or headlights on, but I don't want to kill the battery if it's a long shoot, so I have to leave the engine running.
What I'll often do is leave the window on the "back side" of the car (from my camera's position) down so I can get back in but not have the lowered window affect my photos.
Modern cars have waaaaay too many random reasons for locking themselves without any driver input. Thank god the engineers haven't (YET!) decided to give cars the power to raise their own windows, too. :willy