There is also an old discussion about “occult effects” on haskell cafe. The discussion is about monads m where idem = pure, in which case your first requirement can be more concisely written as a >> b = b. There are Haskell monads that have this property, but not many. The mathematicians call these the “affine” monads, the effect researchers call it a “discardable” effect.
My gut feeling is that idem can not be implemented for general m because it is undecidable in general whether a function is constant or not. (It would solve the halting problem.)