Interesting. You can try it out here: https://semgrep.dev/editor/
It doesn't appear to catch the following when searching for exec(...) in the following python code:
not_exec = exec
not_exec('rm -rf /')
Edited to include language