Search for PLC output amplifier. You want a 3.3 VDC input to a 24VDC output. I think they go up to 32 channels. It's just a lot of wiring, unfortunately.
Check AliExpress for Modbus 32-channel input and 32-channel output modules. To connect the Teensy to the modules, you will need either RS232 or RS485 signal drivers. Higher channel counts tend to be NPN. There is a 64-in/64-out module.
Due to the 1.0mm pad pitch, no direct SMD mount socket is available. The microSD socket requires a 1.1mm pad pitch. In the past, users have been advised to solder short leads or a ribbon to the pads and connect them to a microSD or SD card socket...