Where does all the power consumption of a CPU go? Does all the power drawn by the PC's CPU get transformed into heat? Or does it get transformed into part heat and part some other kind of energy?
In the CPU it's all heat. It's the changing from 0 to 1 and back (which ultimately is what a computer does) which consumes the energy, because charge has to be moved from one place to another, and it's this current (moving charge) through resistance which causes heat. \$P = I^2 \times R\$
Ideally a computer which doesn't perform any tasks consumes no energy, but there are always tiny charge leaks and in a 1 billion transistor processor like a Pentium that combination of small leaks still causes a lot of power losses.
The electrical power sent into almost(*) any CMOS-based CPU through its VCC and GND pins goes to 3 places:
Electrical power leaves the CPU through its output pins to drive the "real power" requirements of external devices. LEDs, LED ballast resistors, transmission lines, transmission line biasing resistors, transmission line terminating resistors, etc. are examples. Those external devices are never 100% efficient, so some or often most of that power is converted to heat which makes those external devices warmer. (Lots of current flows through transistors in the I/O pad ring, but relatively small voltage across those transistors). This is often the biggest fraction of power in low-power CPUs that drive lots of LEDs.
Electrical power gets converted to heat in the transistors in the I/O pad ring driving (charging and discharging) external capacitance. The parasitic capacitance of PCB traces, the small gate capacitance of the input pins of RAM and other CMOS chips, the large gate capacitance of big discrete FETs, etc. are examples of such external capacitance. Over each charge/discharge cycle, all of the energy that was temporarily stored in that capacitance is dissipated as heat in the channel of I/O pad transistors of the CPU. (The instant-by-instant details of where the power goes during that cycle are more complicated).
(Similarly, the CPU's input pins are usually driven by transistors in the I/O pad ring of some external chip. Over each charge/discharge cycle, all of the energy that was temporarily stored in capacitance inside the CPU is dissipated as heat in the channel of the I/O pad transistors of that external chip. In other words, no net power enters or exits through the CPU's input pins).
Electrical power gets converted to heat in the internal core transistors driving (charging and discharging) the gate capacitance of other internal transistors. Again, over each charge/discharge cycle, all of the energy that was temporarily stored in that capacitance is dissipated as heat in the channel of internal core transistors. This is the biggest fraction of power in high-power desktop CPUs.
(*) Some researchers have built energy recycling logic devices (including the Tick, FlatTop, and Pendulum CPUs) that, rather than dissipating as heat all of the energy temporarily stored in internal and external capacitance, instead returns most of that energy back to the power supply.