Every time I create a new project with Particle Workbench (on Windows), a nul file is made too. When I use Git to make any changes to the folder like stage or add, that single nul file always creates a fatal error.
I find that my little nul file gets created when I compile locally. I just tried making a new project but I didn't see it get produced.
You're right that you can't right click delete it, but you can still remove it with rm nul from a command prompt window. Also if you select it in the explorer tab of Visual Studio Code, you can right click delete it from there.
To make sure git doesn't pick it up, simply add nul to your .gitignore file.
It seems to be coming from %UserProfile%\.particle\toolchains\buildscripts\1.15.0\Makefile around line 44. If I change that to /dev/null instead then it doesn't create the nul file in my source directory.
I was concerned that it might be writing to some random file elsewhere so I watched sh.exe with Process Monitor, it doesn't write to any file. I'm pretty sure that was the intention.