Share code of geometry processing of mesh selection. For now, `mesh_copy_selection` is only user of this code, but in #115142 this will also be used. Pull Request: https://projects.blender.org/blender/blender/pulls/115376