There is no such function, and for good reason.
First of all, setting package.loaded[pkg] = nil
is not an official way to unload a module, especially C code. See one of my previous answers. Additionally, unloading cdefs is not that simple; what happens if you unload a cdef that has objects using it?
The only way to test code that runs cdefs is by creating a new lua_State
or luajit process for each test.
(Also, it's Lua, not LUA)