Is there a way to set per-function compiler options?

Yes, clang getting support for that GNU extension is why LLVM is getting/has gotten support for per-function compiler options, however, rustc is not GCC, nor do we use the GCC backend, so it unfortunately isn't immediately helpful.