In reply to Pete.

I disagree. A user can add a gallery to their post content, so why shouldn't they be able to add a gallery to their sidebars?

Storing widgets in a custom post type is planned, see: https://core.trac.wordpress.org/ticket/35669

However, this would probably be part of the migration from widgets to blocks. Work is being done in Gutenberg on such a block post type right now.