constexpr Precalculate size of serialized data with templates and C++20 concepts
Stick with supporting the lowest common denominator
I don't see a difference in functionality in the GCC and MSVC version of your code, so I wouldn't bother writing two implementations. That is just repeating yourself in a way.
Also note that it's not really GCC vs MSVC, it is some version of GCC and some version of MSVC that you checked, that doesn't mean all versions of those compilers have the same difference. Older versions of GCC might also not support some C++20 features that you used, and newer versions of MSVC will likely support those at some point.
Also, what about Clang, ICC and all the other compilers out there?
Use feature testing macros
If possible, use feature testing macros instead of testing for compiler brand to check whether you can use a given feature.
You can't serialize all containers by just looking at their contents
Containers can be more than just their contents. The ordered STL containers for example allow you to provide them with a functor that tells them how the elements are to be ordered. And if you go outside the STL, consider what happens if you have for example a class that implements a binary tree, and that provides begin() and end() functions to traverse the tree in-order. If you serialize just the elements, you miss the way the nodes in the tree are linked together, which might be significant information.