Whoever told you that is an absolutely clueless idiot. You can’t circumvent the law with an agreement, no matter what.
Oh, but wait a minute, if it’s notarized.....that changes everything!
Why would squatter or potential squatter sign that
Best way to prevent it is to be cautious of who you rent to.
This is going to sound snarky, but I am being sincere.
Buy rentals outside of California.
Might as well put in the document that the squatter must mow the grass and wash your car every week too. You think a squatter cares about the legal system the document or the property ??? . These are lowlife grifters who do nothing by the book . No wording on a document is going to affect them from stealing services