(a) Whenever a nonresident is arrested for violating any section of this code while driving a motor vehicle and does not furnish satisfactory evidence of identity and an address within this state at which he or she can be located, he or she may, in the discretion of the arresting officer, be taken immediately before a magistrate within the county where the offense charged is alleged to have been committed, and who has jurisdiction over the offense and is nearest or most accessible with reference to the place where the arrest is made. If the magistrate is not available at the time of the arrest and the arrested person is not taken before any other person authorized to receive a deposit of bail, and if the arresting officer does not have the authority or is not required to take the arrested person before a magistrate or other person authorized to receive a deposit of bail by some other provision of law, the officer may require the arrested person, if he or she has no satisfactory identification, to place a right thumbprint, or a left thumbprint or fingerprint if the person has a missing or disfigured right thumb, on the notice to appear as provided in Article 2 (commencing with Section 40500). Except for law enforcement purposes relating to the identity of the arrestee, no person or entity may sell, give away, allow the distribution of, include in a database, or create a database with, this print.