You can try

/in 2 /run StaticPopup_Hide("PARTY_INVITE")

or some variant of that. I know it works for chat and a few other minor things. Never tried it out of combat on other things.