It's not just a question of clock frequency, but of overall performance. With the same clock frequency, the Cortex-M4 and -M33 are considerably more powerful than the Cortex-M3, for which there have been no new derivatives for a long time, and for good reason.
Alternatively, you can also take a look at the STM32L4+ or STM32L4 series, e.g. the STM32L431RC.
Good luck!
If the problem is resolved, please mark this topic as answered by selecting Select as best. This will help other users find that answer faster.
/Peter