Any surety may, after default, pay to the clerk of the court the amount for which the surety was bound, or such lesser sum as the court, after notice and hearing, may direct, and thereupon be discharged.