If you can't guarantee that this cake will be kept adequately cool until just about serving time, you don't want to prepare any icing (or filling) with butter, or eggs, or milk, or cream cheese. You're risking melting at least and food poisoning at most.
First of all, I don't think food poisoning is very likely from a frosting that's been out a few hours. I have never known anyone to get sick from eating cream or butter that was a little sour.
And incidentally, you're wrong about buttercream, which like Ganache, and other fat/sugar heavy products does NOT need to be refrigerated, and will not go bad at room temperature. Bacteria need water to grow, and large amounts of sugar and fat bind the water molecules making bacterial growth impossible. Look at the truffles you buy at any candy store. They are stored at room temperature for days and even weeks, and they don't go bad, even though the ganache is made from cream and butter.
If you want to make the buttercream more resistant to heat, then you'll have to use a shortening based recipe. Shortening is inferior to butter in terms of texture and taste, but its higher melting point makes it more resilient in the heat.