The Teensy 4.x are based on a Cortex-M7 chip[1] from NXP. The STM32H7 line is also based on a Cortex-M7, though officially only up to 550MHz.
I haven't studied the capabilities much, the biggest difference I could see was that the 550MHz version of the H7 only comes with 0.5MB SRAM vs 1MB SRAM for NXP one, while the H7 with 1MB SRAM only goes to 480MHz. However the STM32 parts comes with flash memory included (up to 2MB), while the NXP one has none. To me it seems the STM32H730VB[2] is one of the closer matches if you favor speed, while the STM32750VB[3] if you favor SRAM, but it depends heavily on the metric used for comparison.
I haven't studied the capabilities much, the biggest difference I could see was that the 550MHz version of the H7 only comes with 0.5MB SRAM vs 1MB SRAM for NXP one, while the H7 with 1MB SRAM only goes to 480MHz. However the STM32 parts comes with flash memory included (up to 2MB), while the NXP one has none. To me it seems the STM32H730VB[2] is one of the closer matches if you favor speed, while the STM32750VB[3] if you favor SRAM, but it depends heavily on the metric used for comparison.
[1]: https://www.nxp.com/part/MIMXRT1062DVL6A#/
[2]: https://www.st.com/en/microcontrollers-microprocessors/stm32...
[3]: https://www.st.com/en/microcontrollers-microprocessors/stm32...