The court may refuse to admit a plea of guilty and it may order that a plea of not guilty be entered. The court may, furthermore, at any time before rendering judgment, permit that the plea of guilty be withdrawn and substituted by the plea of not guilty or, with the consent of the prosecuting attorney, by the plea of guilty of an offense inferior to the one charged but included therein, or of a lower degree than the offense charged.