I used this a while back to simulate a 16+ port MIDI thru device using PIO on a Raspberry Pico[1]. It worked surprisingly well with just a small amount of simulation slowdown. Theoretically it might be possible to replace a $200 Kenton Thru 25 (though only 23 max) for about $40 in hardware + whatever a case costs.
[1]: https://www.joshka.net/pio-for-midi-with-raspberry-pi-pico/