Unfortunately, Python itself doesn't automagically do this yet:
- https://github.com/python/cpython/issues/81338
- https://github.com/python/cpython/issues/81340
But you can see how we handle it at https://github.com/gentoo/portage/blob/22e027aef2ddb49d1c4e2423b5b1f3c209ac8efe/src/portage_util_file_copy_reflink_linux.c if interested.
Fortunately, other libraries are starting to allow transparent use!
Jannik Glückert recently implemented support in libstdc++ [0][1] which will arrive in GCC 14.
[0] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=f80a8b42296265bb868a48592a2bd1fdaa2a3d8a
[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=d87caacf8e2df563afda85f3a5b7b852e08b6b2c