Costs shall not be imposed by a justice as a penalty for a crime. A justice may, as a condition of the dismissal or placing on file of a complaint or indictment, or as a term of probation, order the defendant to pay the reasonable and actual expenses of the prosecution. A justice may impose reasonable costs as a result of a default by a criminal defendant that was intentional or negligent and without good cause.
Mass. Gen. Laws ch. 280, § 6