Is it possible to clone directories in APFS?
clonefile() is the system call that you're interested in. It was introduced in macOS 10.12 (Sierra), coinciding with the public beta release of APFS.

copyfile() is a C library function that was introduced in Mac OS X 10.5 (Leopard). As you have seen in the manpage, while it does support file cloning, this is not the default behaviour.

I am not sure why clonefile(2) states that "the use of copyfile(3) is more appropriate for copying large directory hierarchies instead of clonefile(2)" — I can only guess that it is for efficiency reasons. Regardless, both APIs will allow you to clone files without duplicating any file extents on disk.

I can confirm that, at least for me, macOS 10.15 (Catalina) does clone large files (tested with files in excess of 100&nbsp;MB in an APFS volume) when "copying" them in Finder, whether using CMD-C and CMD-V, or ALT-drag-and-drop. The same is true for directories, in the sense described in clonefile(2). That is, all directories involved are copied (new inodes and dentries will appear on disk), and all files involved are cloned.

It's worth noting that, in order to comply with POSIX, cp is required to make non-clone copies (duplicate the file extents on disk), but using it with the -c flag will override this behaviour and clone files via clonefile() instead — see cp(1). Thus, cp -Rc is what you're looking for if you want to clone directories on the terminal. I am not sure when this flag was introduced, but it was likely alongside the release of clonefile() in macOS 10.12. According to this talk (1.28 GB MP4 file) by Tim Standing, this has at least been the case in public releases of macOS since January 2018.