Modern EE is full of clever tricks like this, just a lot less about cost because it's marginal but for very subtle things like DFM, reliability, etc... Just look at a mass manufactured board like from Apple or Samsung. Shit is fucking whack, yo.
When I first started getting into Arduino type systems, I was concerned about the limited number of inputs. After studying other designs, I saw a simple method of making each pin capable of accepting multiple inputs. Each input had a different resistor attached so that the voltage from each input/button was unique on that pin. Very simple/basic solution, but still creatively done nonetheless.