(a)
The judge or magistrate may, either of his or her own motion or upon the application of the prosecuting attorney, and in furtherance of justice, order an action to be dismissed. The reasons for the dismissal shall be stated orally on the record. The court shall also set forth the reasons in an order entered upon the minutes if requested by either party or in any case in which the proceedings are not being
recorded electronically or reported by a court reporter. A dismissal shall not be made for any cause that would be ground of demurrer to the accusatory pleading.
(b)
This section does not authorize a judge to strike any prior conviction of a serious felony for purposes of enhancement of a sentence under Section 667.
(c)
(1)If the court has the authority pursuant to subdivision (a) to strike or dismiss an enhancement, the court may instead strike the additional punishment for that enhancement in the furtherance of justice in compliance with subdivision (a).
(2)
This subdivision does not authorize the court to strike the additional punishment for any enhancement that cannot be stricken or
dismissed pursuant to subdivision (a).