My inkling based on your description is that this is a battery related issue. There are temperature sensors in the battery that talk to the SMC and if the SMC doesn't get information from them, it kicks the computer into a protective mode. Fans ramp up to full and it throttles the CPU way down in case the reason for the missing sensor data is super high temperatures.
Lithium-ion batteries, like the one in modern MacBooks don't like extreme heat. You can't always tell if the battery is bad just by looks alone. But its time in a hot car may have just killed the battery.
Luckily, [guide|142673|battery replacement on these|new_window=true] is quite easy (comparatively to a MacBook Pro of the same era).