This answer is a variation of Daan Koetsenruijter's response who built upon half the thread here and upon LeoZ's response. So this is a remix of most of this thread. I remixed it because I wanted more control over what's going on and don't like a probably little tested (python) script that I can only read somewhat to mess with my settings. That's not critisizing Daan, it's my problem - thanks a lot Daan (and LeoZ, too), you basically solved it for me!
So, what I did is write a little command line that dumps the files I want to exclude and copy that to the respective value into the dconf editor (see LeoZ's response!).
And this is an example of such a command line:
find /home/myUserName -name node_modules -printf "'%P',\n" | grep -v 'node_modules/.*/node_modules' | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/ /g'
This does three things. The first command, "find" finds all directories I want to exclude (node_modules in this case) and formats it into the required format using "-printf". Don't do "find . [...]" because then the output will also be relative paths but you want absolute (and replace my username, obviously). Note that -printf adds a newline. This is in order to simplify the next command, the newline will be removed with the last command. Depending on your use case, you may simplify this.
The second command "grep" removes nested node_modules directories, in my case reducing the number of exclude entries from 15,000 to 250 or so.
Finally "sed" removes the newlines again. This can be simplified by not adding the newlines in the first place and using a smarter regExp in grep, but I couldn't be bothered :-)
I recommend removing the "sed" command and reviewing the exclude list first.
Caveats: If you have ' characters in the file-/dir-names you want to exclude, you need to solve another problem, but dconf editor probably saves you from breaking your settings (it checks the syntax). I guess there's more that can go wrong, so take care.
Thanks everybody in this thread for your help!