Oh. Using a 74HC165 for the input sensors would require 4 pins from the Microcontroller.
using a 4021 multiplexer would require 3 pins.
If there is I2C on board, then a MCP23008 (or MCP23017) would be a great option. No extra I/O pins needed at the expense of loading an I2C library. Pullups/pulldowns can be implemented making this quite reliable.
If SPI is available, then the MCP23S17 would be even better!
Can probably pinch the clock signal used to drive the HC595 output shift register if you’re still using that in the V3 board.