> why are you rebuilding expr?

Just to factor out constant term.   Indeed, ``expr.as_independent(*symbols)[1]`` -- should be enough.

> then you should use , as_Add=False in as_independent