I suppose, though, that if you switch any part of your Lua
ecosystem to clang, you will have to switch all of it.
Recompile all .so modules you use, etc.
Your suspicion is wrong. It cooperates nicely with gcc/g++, you can even use build some .o files with gcc, some with clang, and the result will link together. You can use clang as a replacement to gcc as it understands the same arguments (maybe apart of some obscure, rarely used switches). It is really easy to test it with Makefile projects that allow you to override CC, i.e. just to build Lua with clang just do (in src folder):