The cost necessarily incurred in determining whether a person is a fit subject for commitment and securing his or her commitment, is a charge upon the county where he or she is committed. These costs include the fees of witnesses, medical examiners, psychiatrists, and psychologists allowed by the judge ordering the examination. If the person sought to be committed is not an indigent person, the costs of the proceedings are the obligation of that person and shall be paid by him or her, or by his or her guardian or conservator, as provided in Division 4 (commencing with Section 1400) of the Probate Code, or shall be paid by persons legally liable for his or her maintenance, unless otherwise ordered by the judge.