Currently writing to the curve type attribute directly from Python
doesn't work because it doesn't tag the curve topology changed.
This is a limitation with the Python attribute API that needs to be
solved generally. In the meantime, this commit adds a `set_types`
RNA function. This will have better performance than writing to
the attribute directly anyway.
This is an alternative to #128410 that avoids tying the type to the
addition of curves.
Pull Request: https://projects.blender.org/blender/blender/pulls/129224