Section 23B. In the trial of an indictment or complaint for any crime, no statement made by a defendant therein subjected to psychiatric examination pursuant to sections fifteen or sixteen of chapter one hundred and twenty-three for the purposes of such examination or treatment shall be admissible in evidence against him on any issue other than that of his mental condition, nor shall it be admissible in evidence against him on that issue if such statement constitutes a confession of guilt of the crime charged.