If you're happy adding a diode to each switch, then you can use charlieplexing to read push buttons. This allows (n^2)-n switches for n pins. It does have downsides (code-complexity, extra parts [diodes], scanning time), but would allow, in theory, 272 switches from the 17 I/O pins. 25 buttons shoul...