(b) In addition to any penalty provided under this section and any restitution which may be ordered by the court under article eleven-a of chapter sixty-one, the court may order any person convicted under the provisions of this section to pay all or any portion of the cost of medical, psychological or psychiatric treatment of the child resulting from the act or acts for which the person is convicted, whether or not the child is considered to have sustained bodily injury.
(c) The provisions of this section shall not apply to any parent, guardian or custodian who fails or refuses, or allows another person to fail or refuse, to supply a child under the care, custody or control of such parent, guardian or custodian with necessary medical care, when such medical care conflicts with the tenets and practices of a recognized religious denomination or order of which such parent, guardian or custodian is an adherent or member.