Best way to save data and apply it to the player?

I want to save the player's (possibly entire) nbt data and restore it at will, what's the best way to achieve this? I just realized you can't use /data to modify player's nbt

Continue to help post