>How does everyone taking the piss intend to protect themselves from this in their OS package manager, or PPM or composer or pip?
By signing packages and not allowing literally anybody to re-upload a brand new package that does something completely different under the name of an existing, widely-used package. There's not much excuse for that in any respectable package manager.