(לב) וְעַתָּ֖ה אִם־תִּשָּׂ֣א חַטָּאתָ֑ם וְאִם־אַ֕יִן מְחֵ֣נִי נָ֔א מִֽסִּפְרְךָ֖ אֲשֶׁ֥ר כָּתָֽבְתָּ׃
(לג) וַיֹּ֥אמֶר ה' אֶל־מֹשֶׁ֑ה מִ֚י אֲשֶׁ֣ר חָֽטָא־לִ֔י אֶמְחֶ֖נּוּ מִסִּפְרִֽי׃
(32) Now, if You will forgive their sin [well and good]; but if not, erase me from the record which You have written!”
(33) But the LORD said to Moses, “He who has sinned against Me, him only will I erase from My record.
(10) Never again did there arise in Israel a prophet like Moses—whom the LORD singled out, face to face, (11) for the various signs and portents that the LORD sent him to display in the land of Egypt, against Pharaoh and all his courtiers and his whole country, (12) and for all the great might and awesome power that Moses displayed before all Israel.
(12) ולכל היד החזקה AND IN ALL THAT STRONG HAND — this refers to the fact that he received the Torah that was on the Tablets, in his hands. (13) ולכל המורא הגדול AND IN ALL THAT GREAT TERRIBLENESS — the miracles and mighty deeds that were wrought in the great and terrible wilderness (cf. Siphre). (14) לעיני כל ישראל [WHICH MOSES SHOWED] BEFORE THE EYES OF ALL ISRAEL — This refers to the fact that his heart inspired him to shatter the Tablets before their eyes, as it is said, (Deuteronomy 9:17) “And I broke them before your eyes”, and the opinion of the Holy One, blessed be He, regarding this action agreed with his opinion, as it is stated that God said of the Tablets, (Exodus 34:1) אשר שברת "Which you have broken", [which implies] "May your strength be fitting (יישר; an expression of thanks and congratulation) because you have broken them" (Yevamot 62a; Shabbat 87a).
(15) who led you through the great and terrible wilderness with its seraph serpents and scorpions, a parched land with no water in it, who brought forth water for you from the flinty rock;
ומה ראה משה לשבר את הלוחות. משל למלך שהלך למדינת הים, והניח אשתו עם השפחות. ומתוך שהיתה עמהם, יצא עליה שם רע. שמע המלך ובא ובקש להורגה. שמע שושבינה, עמד וקרע כתובתה. אמר, אם יאמר המלך כך וכך עשתה אשתי, נאמר לו, עדיין אינה אשתך. בדק המלך אחריה ולא מצא בה ערות דבר אלא השפחות הם היו שקלקלו. מיד נתרצה לה. אמר לו שושבינה, מרי, עשה לה כתובה אחרת שנתקרעה הראשונה. אמר לו, אתה קרעת אותה, לך והביא את הנייר משלך ואני כותב כתב ידי.
Midrash Tanchuma Ki Tissa:30
Once there was a king who went off on a distant journey and left his bride with her maidservants. Because of the [promiscuity of the] maidservants, rumors began circulating about the king’s bride. The king heard of this and wished to kill her. The bride’s guardian heard of this, so he went ahead and tore up her marriage contract, saying: “Should the king say, `My wife did such and such,’ we shall say to him, `She’s not your wife yet.’ “ The king subsequently investigated and found that there was nothing promiscuous in his bride’s behavior, that only the maidservants were corrupt, and was reconciled to her. Said the bride’s guardian to the king: “Sir, make her another marriage contract, for the first one was torn up.” Said the king to him: “You tore it up, so you supply the paper and I shall write on it with my hand” … Thus, when G-d forgave [the Jewish people], He said to Moses: “Carve for yourself, two tablets of stone [like the first ones, and I shall write on these tablets what was on the first tablets, which you broke].”
