You can also copy functions from the old metatable to the new one. This will impose a longer setup time and use up more memory, but will save CPU usage during runtime. Taint is also a problem if the frame is protected, but it's unclear whether the replacement of the frame's metatable would cause taint by itself anyway.
Lua Code:
local frame=CreateFrame("Frame")
local meta={__index={}};
-- Define functions after these lines
for name,func in pairs(getmetatable(frame).__index) do meta.__index[name]=func; end
setmetatable(frame,meta);
function meta.__index:foo()
print("bar");
end