/notify_update is an undocumented feature used by CMake. From their usage, it looks like this feature just changes mt's exit code if the output file was changed. See https://gitlab.kitware.com/cmake/cmake/-/blob/master/Source/cmcmd.cxx#L2300 this is also consistent with some testing I have done of the mt.exeshipped with Visual Studio. See also the comment at https://gitlab.kitware.com/cmake/cmake/-/blob/master/Source/cmcmd.cxx#L2440.
There might be a more performant way to implement this by first checking calling llvm::sys::fs::file_size() and if it is the same as the new output's size use llvm::WritableMemoryBuffer and fallback to llvm::FileOutputBuffer otherwise, but these don't inherit from a common ancestor so any implementation doing this would be really ugly.