Tiny Lua library to get char pointer from string
I'm no Lua expert, but I can at least give you a pointer (no pun intended) about your C code.

Your get_pointer function looks like it works fine, but it could be made even more concise! Lua provides a luaL_checkstring function that combines luaL_checktype and luaL_tostring. Therefore, you could just do this:

int get_pointer(lua_State *L)
{
    lua_pushlightuserdata(L, (void *) luaL_checkstring(L, 1));
    return 1;
}