Upon motion of any defendant, the court shall order a mental examination of the defendant before making any determination of competency under Sections41-13-3 [NMSA 1953] or 31-9-1 NMSA 1978. Where the defendant is determined to be indigent, the court shall pay for the costs of the examination from funds available to the court.
NMS § 31-9-2