And you, what’s your operating system to code ? Me, I use Arch btw
I remember having bad overheating issues with Linux years ago on an XPS 15 (9560 model if memory serves, so unlike yours no 4k or touch).
The key on mine was to disable the dedicated GPU which I didn’t need anyway. I remember afterwards, mint would run mostly quiet and the battery lasted longer than on the windows partition. If you are interested look up bumblebee on the arch wiki.
Also I know this reply is late, but maybe it helps.
I already thought about disabling the dedicated GPU on that laptop, but I unfortunately cannot since I need it to train neural networks and the occasional lan party at, work