First question is why you would want to? The point (in most cases) of passing a hashref into the function is so that the data isn't copied (waste of time and memory). But If you really wanted to (maybe this is just a one-liner excercise), this seems to do the trick:
sub f {
my %args = do { ref($_=shift) eq 'HASH' or die "arg is not a hashref
+"; %$_ } ;
...
}