Some previous discussion on the topic :
However, it seems like if you change the underlying pin abstraction then you also need to rewrite each and every library that uses IO pins.
One application area that needs flexible compile-time user config and also efficient run time is in 3D printer/CNC firmware, e.g. grbl, Marlin. I'm very much in the "Keep it Simple" camp, and so far I haven't seen a C++ abstraction for IO pins that I would use; macros and inline functions are "good enough".
The sad thing about computer science is that despite all our efforts to engineer better software, these come at a cost of greater complexity. But the hardware guys can just drop in a new CPU which is cheaper and faster, and then many of our concerns about RAM and CPU cycles disappear.