AFAIK, this behavior is tied to the new Markdown features introduced to Windows 11 Notepad. Microsoft redesigned the application from a legacy plain-text utility into a modern editor capable of handling rich text formatting, headers, italics, and markdown files to fill the gap left by the discontinuation of WordPad.
In standard Markdown syntax, underscores are markup characters used to generate italics or bold formatting. Because the modern Windows 11 Notepad now natively parses Markdown, its backend engine scans the text field for these characters. When the automatic Session Restore feature kicks in to save your progress, the application's underlying save mechanism assumes the underscore is a Markdown formatting command. To prevent the text from accidentally italicizing, the engine applies a backslash to escape it, changing your typed underscore into an escaped format.
If you want to prevent this behavior without turning off your session cache, you should be able to toggle your document display settings. You can do this by clicking the Formatted or Syntax view toggle button located in the status bar, or by navigating to the View menu and adjusting the Markdown settings. Disabling rich text formatting in the Notepad settings menu should also restore the traditional plain-text saving behavior.
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin