What shoes/ clothes you wearing? That will make a difference. Fleece clothes, smooth joggers etc will all cause static. Or certain shoes will do too.
Few options,..
1) open the door and ground yourself (literally touch the floor) before getting out / touching the door to close.
2) get a tacky rubber strip that dangles under the car so it‘s another way to remove static energy...looks crap though
3) swap items of clothing / shoes and find out which is causing it. Then when you wear that particular item again you know to lean out and touch the floor before anything else. Looks stupid but works.