I have a local folder that I use as a scratch pad for multiple little sample and toy pieces of code. I store a host of python, C++, shell scripts etc. in this directory.
You could write and run a custom script file instead of python etc. directly. In the script file you would extract the file extension in order to call python, clang or whatever the compiler/translator neededmay be.
So your task file would look like this;
// A task runner that runs a program
{
"version": "0.1.0",
"command": "${workspaceRoot}\\runProgram.sh"
"args": ["${file}"]
}