(b) Prior to any person being required to pay the cost of his or her incarceration pursuant to the provisions of subsection (a) of this section, a hearing shall be held before the sentencing court to determine his or her ability to pay. The court may not sentence a defendant to pay his or her costs of incarceration unless he or she is or in the foreseeable future will be able to pay them. In determining the amount and method of payment of costs, the court shall take account of the financial resources of the defendant and the nature of the burden that payment of costs will impose.
(c) A defendant who has been sentenced to pay costs and who is not in willful default in the payment of the costs may at any time petition the sentencing court for remission of the payment of costs or of any unpaid portion of the costs. If it appears to the satisfaction of the court that payment of the amount due will impose manifest hardship on the defendant or the defendant's family or dependents, the court may excuse payment of all or part of the amount due in costs, or modify the method of payment.