Well, with FFI it should be really straightforward to get there:
• write your inline C as a multiline string, no need to care about the Lua stack in this code; it's just plain C.
• call gcc on this string, and generate an .so
• use ffi.cdef and ffi.load to expose and load your so
and you should be done :-)
Now I think that you should need a lot of C anymore with LuaJIT: for instance looping over pixels of an image, using a cdata pointer, in pure lua, is essentially as fast as C.
Is there a specific case where you think C still makes sense?