Confusion with EditorPlugin _get_unsaved_status and _save_external_data

Godot Version

Godot 4.3

Question

This isn’t so much a “help” request, but wasn’t sure where else it could go. I was looking at the documentation for EditorPlugin and noticed that although _get_unsaved_status takes in the scene as a parameter, it still calls _save_external_data if the user agrees to saving, but there doesn’t seem to be a way for the plugin to know what scene it was requesting to be saved for. This is fine for my usecase, but it got me thinking about how saving scene specific data as a result of the user agreeing to the prompt for _get_unsaved_status would even work. At first I thought maybe you could store the for_scene from the last _get_unsaved_status call in a variable on the plugin, but there would be no way to clear it if the user declines to save.

I guess my question then is, what is the workflow for saving scene specific data in this manner? Specifically, as a result of returning a non-empty String from _get_unsaved_status and the user accepting, how do you handle that?