of course it is legitimized. I just meant that the selling point of binfmtc is that the same .c file can either be compiled by any C compiler, or executed directly.
We could perhaps split it into a two-file system where a "foo.sh" containing certain boilerplate will execute a "foo.c" that doesn't require any special conventions at all.
"foo.sh" could be identical for any .c file, and so we could symbolically link them all to a common file.
Of course, neither that file nor symlinks to it require a .sh suffix.
The contents might look like this:
#!/bin/sh
c_file=${0%.sh}.c
x_file=${0%.sh}.bin
# If cached executable file is missing, or out of date w.r.t.
# the source file, compile it:
if [ "$c_file" -nt "$x_file" ]; then
cc $CFLAGS "$c_file" -o "$x_file"
fi
# Run cached executable file
$x_file
https://rosettacode.org/wiki/Multiline_shebang#C