Using PinChangeInt in multiple libraries

For a start, attachInterrupt/detachInterrupt only refer to the external interrupts, not the pin change ones. They did that by making a level of indirection where the "real" interrupt calls a function stored in an array (by attachInterrupt).

There is a cost ... the attachInterrupt handlers are slower than "pure" interrupt handlers.

If you try to add your own indirection you will be adding this extra cost. Bearing in mind interrupt handlers are supposed to be as fast as possible.

Also I don't like the idea of:

I would like to be able to attach and detach interrupts within library functions ...

I hope you don't mean continuously, because interrupts by their nature are unpredictable. The best you could probably do is chain them, and even that might not be optimal - both for speed reasons, and the question of "which handler gets to be serviced first?".

I'm inclined to ask "what problem are you trying to solve?". The idea of nice libraries is all well and good, but this is a $5 chip with some limitations. At times we have to work within those rather than trying to be too general.