Evaluation of default values seems to have nothing to do with the case I described. The default values are both tags = {}, and still inside mysearch() I sometimes get some value from previous call inside tags, when the tags keyword argument is not specified.