(a) A judge of the circuit court, a judge of the district court or a commissioner of the district court, may, unless otherwise prohibited by law or rule of court in any criminal or motor vehicle violation, release the defendant on his person recognizance.
(b) In all criminal or motor vehicle violations for which bond has been set, it may be complied with by a defendant or by a private surety acting in his behalf, by the execution of a bond in the face amount thereof and depositing with the clerk of the court or the committing magistrate a sum of money equal to ten (10) percent of the penalty of the bond. A judge or commissioner may increase the percentage of cash surety required in a particular case up to one hundred (100) percent, but in no event shall a cash deposit be less than twenty-five dollars ($25.00). This provision permitting the posting of a percentage of the cash surety required does not apply if the defendant has been arrested for failure to appear in court or for contempt of court. Upon depositing the sum and executing the bond, the person shall be released from custody, subject to the conditions of the said bond. When all conditions of the bond have been performed without default and the defendant has been released from custody in the cause for which the bond was posted, the central bail bond clerk shall return the amount deposited to the person entitled thereto. If the defendant fails to perform any or all of the conditions of the bail bond, it shall be forfeited; and in the event of forfeiture, the liability of the bond shall extend to the full amount of the penalty of the bond set and the amount previously posted as a deposit shall be applied to reduce the liability incurred by the forfeiture. (Mont. Co. Code 1965, § 4-9; 1945, ch. 943, § 141I; 1971, ch. 765, § 4.)