My best guess is the STM32F example implements ST's HAL (Hardware Abstraction Layer). Think of HAL as Arduino junk in steroids. But then again, the STM32F103C is a much much more complicated MCU than what is on the Arduino Nano, hence the extra junk of abstraction. The "clock initialization" alone would take up space that an AVR MCU can do is less than 5 lines of code or so.
You will have to look at what e.g. digitalWrite() exactly does.
My wild guess is that due to the internal 'complexity', more registers need to be manipulated. This might mainly be in the initialisation of the processor (init() function).
Add blinking of another pin in both codes and see how much the code grows in both cases; you don't need to physically connect a led. You can repeat for a third pin. Draw your conclusions based on that.