Considering that it's possible for an entity to be using multiple shaders, this sounds like a difficult thing to achieve. I'd approach the problem by maybe having custom fields where you can manually set the "default" shader for that entity, or just have default shaders for different types of entities stored in constants or something, might not be applicable for your case though.
What I would like to see would be being able to remove forced shader without having to actually know the originals, the engine should already know it.
EDIT: Actually that seems to work, if you do self.forceshader = 0; it seems to use the original shader again