I missed it back in post #9. That is along the lines of what I was thinking. Can you get one Arduino to talk with the 8 MCP23017s?
Depending on how “much” of the Mega is used, you may be able to drop to a smaller less expensive Arduino model (such as a Uno, Nano, or Mini).