STM32F103C8T6 Maximum IO Output Speed
You have a couple of better options for driving GPIO pins:


Timers. On this part, you have seven timers, most of which can be configured to set/reset/toggle pins on certain events (such as compare match and overflow).
DMA. Set up a DMA transfer to the GPIO bit-set/reset register and you can toggle bits at bus speed. Or you can hook it up to a timer to set bits at whatever rate you want.
Creative uses of other peripherals. USART and SPI/I2S seem like particularly likely candidates.