I was able to add something to the metadata of the png file in the case of the Image engine. We have to choose which exif tag the ID should be written to since they are predefined and standarized. I suggest "Description" or "Comment".
For matplotlib I was also able to write something to the exif fields "Title" and "Author". Unfortunately, both "Description" and "Comment" do not work. Although according to their documentation they should: https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.savefig.html
When I say it does not work, I mean that my file browser does not show these two fields but the other ones.
If we don't get it to work via mpl, we still can do it the same way as for the image engine by opening the image with PIL after the export via mpl. But I like it more if the metadata is set directly with the original export.