"that sounds like a better way to write files in general. No more pesky partially-written files if something goes wrong;"
You can do that already by creating a file with the "wrong" name (e.g. "config.cfg.new") and calling rename(2) when you're finished. e.g.
"instead open with O_TMPFILE and atomically link it with a certain name once you're finished."
Unfortunately, there currently is no way to create a new link to a file for which you only have a file handle.
There are some cases in which it wouldn't make sense, such as trying to link a socket fd into a filesystem, or creating a link in a mountpoint where the file does not reside, but a hypothetical fdlink() could return EXDEV as per rename() in that case. In any case, no-one's implemented it yet.
"The piece that's missing is an atomic link-and-unlink operation where you link a file into a directory with a given name, at the same time unlinking any file that was previously there with that name"
rename(2) already does this.
"(or even renaming the existing file atomically)."