macOS has the clonefile*() calls to create a new file that's a clone of an existing file, but is it possible to clone only parts of an existing file into a different existing file? Linux (FICLONERANGE) and Windows (FSCTL_DUPLICATE_EXTENTS_TO_FILE) both provide this functionality.
I previously filed FB12737014 with this request.
Sounds like what might work for you is something like a CLONE_OVERWRITE flag to fclonefileat() which discards an existing file’s data (if any) and replaces it with the cloned bytestream, instead of failing with EEXIST. Granted you’d still need to resolve the destination FD into a parent FD / name pair, and you’d still need a fallback path for applications that want to do something more complicated than clone the entire file. If that sounds viable feel free to file a new feedback request and post it here; no promises but it might have a better chance of getting implemented than the broader feature you initially requested.