(opto)isolated PISO shift register able to "read" at 24V
Convert 24V to a lower voltage using a simple voltage divider, this needs 2 resistors per input. Values can be quite high, so the input resistor will double as R for the RC lowpass filter and ESD protection. Add a capacitor across the lower resistor for filtering.

These feed the inputs of your PISO shift registers, which of course run on 5V from a regulator powered from the 24V side.

Now, add isolators on the serial link. You will need 2-3 isolators only, instead of one isolator per input.