Cal. Civ. Code § 2856
(a) Any guarantor or other surety, including a guarantor of a note or other obligation secured by real property or an estate for years, may waive any or all of the following:
(c) Without limiting any rights of the creditor or any guarantor or other surety to use any other language to express an intent to waive any or all of the rights and defenses described in paragraphs (2) and (3) of subdivision (a), the following provisions in a contract shall effectively waive all rights and defenses described in paragraphs (2) and (3) of subdivision (a):
(2) If the creditor forecloses on any real property collateral pledged by the debtor:
(B) The creditor may collect from the guarantor even if the creditor, by foreclosing on the real property collateral, has destroyed any right the guarantor may have to collect from the debtor.
This is an unconditional and irrevocable waiver of any rights and defenses the guarantor may have because the debtor’s debt is secured by real property. These rights and defenses include, but are not limited to, any rights or defenses based upon Section 580a, 580b, 580d, or 726 of the Code of Civil Procedure.
The guarantor waives all rights and defenses that the guarantor may have because the debtor’s debt is secured by real property. This means, among other things:
(d) Without limiting any rights of the creditor or any guarantor or other surety to use any other language to express an intent to waive all rights and defenses of the surety by reason of any election of remedies by the creditor, the following provision shall be effective to waive all rights and defenses the guarantor or other surety may have in respect of his or her obligations as a surety by reason of an election of remedies by the creditor:
The guarantor waives all rights and defenses arising out of an election of remedies by the creditor, even though that election of remedies, such as a nonjudicial foreclosure with respect to security for a guaranteed obligation, has destroyed the guarantor’s rights of subrogation and reimbursement against the principal by the operation of Section 580d of the Code of Civil Procedure or otherwise.