I'm not the OP, and I don't know about Polestar specifically, but I've worked with many other vehicle systems, and they are incredibly complex. Each ECU in a car is running it's own firmware, and the larger ones can be running their own OS.
There's usually a mix of Assembly, Simulink, C, C++, Java, JavaScript, Shell scripts, Python, etc...
I've seen the OS be various flavors of embedded Linux, QNX, or even Ubuntu.
You can usually find a bit of everything even in a single vehicle. The code is integrated by an OEM and can come from dozens of potential suppliers.