If you really want to, you can make it atomic by using the Transactional NTFS API [1]. Though I suppose you need a non-atomic fallback in case the file is not on an NTFS volume.
[1] https://learn.microsoft.com/en-us/windows/win32/fileio/when-...
[1] https://learn.microsoft.com/en-us/windows/win32/fileio/when-...
https://learn.microsoft.com/en-us/windows/win32/fileio/about...
Given that this notice seems to exist since at least 2012, and neither Windows 10 nor 11 deprecated it, the TxF API will probably outlive whatever software you're writing today.
It's deprecated in all but name only.