Whenever a bond, undertaking, recognizance, or other obligation is by law, or the charter, ordinance, rules, or regulations of a municipality, board, body, organization, or public officer, required or permitted to be made, given, tendered, or filed, with surety or sureties, and whenever the performance of an act, duty, or obligation, or the refraining from an act, is required or permitted to be guaranteed, the bond, undertaking, obligation, recognizance, or guaranty may be executed by a surety insurer qualified to act as surety or guarantor as authorized in this title. The execution by the insurer of the bond, undertaking, obligation, recognizance, or guaranty shall be in all respects a full and complete compliance with every requirement of the law, charter, ordinance, rule, or regulation that the bond, undertaking, obligation, recognizance, or guaranty shall be executed by one surety or by one or more sureties, or that the surety shall be a resident, or householder, or freeholder, or either or both, or possessed of any other qualifications; and all courts, judges, heads of departments, boards, bodies, municipalities, and public officers of every character shall accept and treat accordingly the bond, undertaking, obligation, recognizance, or guaranty when so executed by the insurer, as conforming to and fully and completely complying with every requirement of every law, charter, ordinance, rule, or regulation.