Hi guys,
Same problem as the most of you here, MBP15 Late 2013, High Sierra, shuts down every 2-5 minutes without any reason, no hardware issues. Been in the Apple Store - they found nothing.
After reading this thread and trying different things (only Python script works in my case ) I think I found another way without creating any additional charge on the CPU and though no additional battery loss.
Here's the link where a guy basically disables most of the drivers: usb, thunderbolt etc and after that no shutdowns MacOS.
In my case when something is connected via Thunderbolt (screen, ethernet etc) MBP doesn't shutdown at all.
So I took from the list of the drivers only Thunderbolt related ones (which start with "AppleThunderbolt") and it runs ok !
But obviously I want to be able to connect external displays via Thunderbolt so I started enabling one after another to see if I can find one which causes problems and I think I found it (at least in my case).
So if you disable (move out of /System/Library/Extensions) AppleThunderboltNHI.kext driver then reboot. Everything runs ok, you can connect external screens via Thunderbolt.
The only drawback is that Ethernet via Thunderbolt will not work.
PS : you can't just move kext driver files from /System/Library/Extensions even if you're root. You need to disable "csrutil" (just google it)
It seems to be working for me also. I'll keep testing it. Thank you!!