Each and every bill of costs presented to any county commission for allowance shall be examined and certified to by the judge and prosecuting attorney in the same manner, all necessary charges excepted, as provided for certifying bills of costs to the director of the department of corrections for payment; and any county commissioner who shall pay, or vote to pay, any costs incurred in any criminal case or proceeding, unless the same is so certified to, shall be adjudged guilty of a misdemeanor.