I'm designing some circuit using STM32L152RBT6 microcontroller. I'm using STM32L-DISCOVERY scheme as a reference of good STM32 practices. I've noticed that free pins of programmer's MCU aren't connected to ground (of course, they can't be connected at demo MCU in the second part of the circuit). I know that leaving free pins not grounded is acceptable in TTL-based circuits, but CMOS technology (on which STM32 MCUs are based) is different. It uses polar transistors. Ideal polar transistor consumes power only at the moment of switching. Also they're driven by voltage and leaving pins free should increase power consumption because of noise voltages. I've heard that grounding unused pins is a best practice to reduce CMOS power consumption. Should I ground all unused pins like on the scheme?
Although you've already accepted another answer, I'll add some more info which may help other readers in future.
For STM32 MCUs, ST often provide a "Getting Started with [MCU model] hardware development" document, which contains useful info on how to integrate that MCU model into your designs. For the STM32L152 which you mentioned, the relevant document is "Getting started with STM32L1xxx hardware development", which says:
To increase EMC performance and avoid extra power consumption, unused clocks, counters or I/Os, should not be left free. I/Os should be connected to a fixed logic level of 0 or 1 by an external or internal pull-up or pull-down on the unused I/O pin. The other option is to configure GPIO as output mode using software. Unused features should be frozen or disabled, which is their default value.
You will also find useful discussions in these previous questions:
Usually, the data sheet explicitly mentions what to do with unused pins. For most microcontrollers, the correct approach is to leave them open on the PCB, and leave the internal pull-up logic enabled after boot (the initial state is safe, so leaving it is safe, too).
It is generally a bad idea to connect I/O pins to a power rail without an in-line resistor. If you ever enable one of these pins as an output, the pin will drive against the power rail, and lose.