Save Python objects in blend file?
A possibility is to use some hidden mesh (or other native Blender object type) to store the wanted data.

Also, as indicated by @batFinger in comments, you can use text blocks as a more versatile solution, if needed.