A couple of other ideas
STM32L1 Routing Interface. These are analog switches intended for touch sensing. Activating two switches in one "touch group" connects the two pins internally.
Timer + DMA to GPIO. Works when DMA is able to write the GPIO registers, target can be any pin. E.g. on STM32F4, TIM1 or TIM8 Channel 1 triggers on TI1 rising edge, Channel 2 on falling edge. They can be assigned to different channels on DMA2. One DMA channel copies the pin set mask, the other one the pin reset mask to GPIOx->BSRR.
SPI with DMA to itself, when you need a specific delay. This again needs a DMA that can copy to/from anywhere. SPI in master mode, RX complete DMA request copies the value in the data register back to itself, creating a true shifter. STM32H7 SPI controller can do it by itself without DMA.