>In practice I think it's about impossible to enforce. Code enforcement or police would need a warrant to enter
If they have a suspicion and they feel inclined to go after you they'll just go hard enforcing all manner of other shit they don't need to go inside to enforce agains the landlord. It doesn't matter that the things they're trying to enforce may very well be bullshit that couldn't stand in court if challenged, it's cheaper to comply than to fight it.
Code enforcement and other civil and administrative areas of law where the .gov can issue fines on the same order or larger than many criminal penalties while giving the accused none of the rights of criminal trial are a massive, massive, massive, I can't say it enough, massive, end run around constitutional rights.