Rule 23. Arrest of judgment.

At any time prior to the imposition of sentence, the court upon its own initiative may, or upon motion of a defendant shall, arrest judgment if the facts proved or admitted do not constitute a public offense, or the defendant is mentally ill, or there is other good cause for the arrest of judgment. Upon arresting judgment the court may, unless a judgment of acquittal of the offense charged is entered or jeopardy has attached, order a commitment until the defendant is charged anew or retried, or may enter any other order as may be just and proper under the circumstances.