This fixes the macOS part of the issue I reported in T87621 (and for which sub task T87867 was created). This fix should prevent Blender from accidentally triggering OneDrive on-demand file downloads when browsing a OneDrive folder using the File Dialog and should also prevent thumbnail generation for those files.
Remarks
I did some research and unfortunately OneDrive currently doesn't use macOS's native placeholder file implementation (as iCloud Drive uses. Probably should be based on NSFileProviderReplicatedExtension). Instead it appears OneDrive adds the com.microsoft.OneDrive.RecallOnOpen extended file attribute to placeholder files. So this code checks for the presence of that extended file attribute to determine if it is merely a placeholder.
Technically that file attribute can also be present on files that aren't located inside a OneDrive folder. So a more thorough check would be to also check if the file is indeed located inside the active OneDrive sync root folder. However, this requires substantially more code, as determining the OneDrive root folder location isn't very straightforward (I do have some experimental code for this).
I'm obtaining the extended file attributes using listxattr(). I tried using macOS Foundation Framework's FileManager, but somehow I couldn't get it to return non-Apple extended file attributes.
I've tried to make the code somewhat generic, so other cloud drive providers can also be added in the future.