Hi all. I'm really just chiming in here obviously for anybody in recent history that's been searching for a solution on this unprovoked shutdown thing. My opinion, in my case - and I feel kind of stupid about it - is that it is indeed about heat. I've had numerous iMacs over the years, and the most recent is a mega slim, late 2012 27", w/2.9 i5. This machine, not long ago started to just...black out. Gone. Sometimes it could be restarted immediately. Sometimes it required pulling the power cord (which made me think the reset was telling me the power supply was going, which I've had before). I'd tried PRAM and other magic, but no real organized plan. And it was always after I'd been working on it for a while, never just a short stop (I also use a MBP extensively, and am not often home to do heavy lifting on the big screen).
Today, it went down; I unplugged briefly, started up. Then it happened again, just minutes later. It's a warm day here, but not so warm that I have AC on, so it's actually a little hotter than usual upstairs where this machine is, with the window open. So at this point, no startup, no matter what. Let it sit for a minute or two, no go. No chime, no nothing.
I then pondered previous machines and the dust I'd found in them when I'd cracked them open for some reason, and I simply flipped the thing upside down and started blowing in the whole row of vents on the bottom edge. And yeah, the dust started flying out. I didn't even bother with compressed air or anything, this felt like my answer, and I'm pretty sure it was, as it started immediately, and hasn't shut down since. I suppose in the interest of full disclosure, I'd also unseated and reseated the RAM while I had the thing flipped over, but it really feels like dust and heat to me.
Not saying this is 'the solution' for even a large percentage of you folks, but I'm here to remind you of the potentially obvious solution...that I had obviously forgotten!