No officer, or other person entitled to or claiming compensation under any provision of Act June 22, 1874 (chapter 391, 18 Statutes 188) shall be thereby disqualified from becoming a witness in any action, suit, or proceeding for the recovery, mitigation, or remission thereof, but shall be subject to examination and cross-examination in like manner with other witnesses, without being thereby deprived of any right, title, share, or interest in any fine, penalty, or forfeiture to which such examination may relate; and in every such case the defendant or defendants may appear and testify and be examined and cross-examined in like manner.