Pass OLD & NEW to a function
You need to assign the RECORD type before sending it as parameter, and a very simple way to do that in your case would be simple assigning it to NEW or OLD even when it wouldn't be necessary, like:

CASE TG_OP
    WHEN 'INSERT' THEN
        old_v = NEW;
        new_v = NEW;
    WHEN 'UPDATE' THEN
        old_v = OLD;
        new_v = NEW;
    WHEN 'DELETE' THEN
        old_v = OLD;
        new_v = OLD;
END CASE;


Notice that now it is very important to use TG_OP and control which variables you must read/use.