<!--- Verify first that your issue is not already reported on GitHub -->
<!--- Also test if the latest release and devel branch are affected too -->
<!--- Complete *all* sections as described, this form is processed automatically -->

##### SUMMARY
My self written module output includes a datetime.date object. This results in a type error here: https://github.com/ansible/ansible/blob/adcdee9bb0031577698246fcfc51f8af63a56a17/lib/ansible/module_utils/basic.py#L397

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME
lib/ansible/module_utils/basic.py

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```paste below
ansible 2.9.6
```

##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
```paste below

```

##### OS / ENVIRONMENT
<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->
python3

##### STEPS TO REPRODUCE
<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->

library/my_test.py
```python
from ansible.module_utils.basic import AnsibleModule
import datetime

if __name__ == '__main__':
    module = AnsibleModule(argument_spec=dict())
    module.exit_json(result={'test_date': datetime.datetime.now().date()})
```

<!--- Paste example playbooks or commands between quotes below -->
```yaml
- name: test
  hosts: all
  tasks:
  - my_test:
    register: out
```

<!--- HINT: You can paste gist.github.com links for larger files -->

##### EXPECTED RESULTS
Running through without an error


##### ACTUAL RESULTS
<!--- Describe what actually happened. If possible run with extra verbosity (-vvvv) -->
The module fails with an exception
<!--- Paste verbatim command output between quotes -->
```paste below
$ ansible-playbook -i localhost, -c local test.yml

PLAY [test] ************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************
ok: [localhost]

TASK [my_test] *********************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: Value of unknown type: <class 'datetime.date'>, 2020-07-12
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/home/jdrummer/.ansible/tmp/ansible-tmp-1594559282.5458276-140886794481795/AnsiballZ_my_test.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/home/jdrummer/.ansible/tmp/ansible-tmp-1594559282.5458276-140886794481795/AnsiballZ_my_test.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/jdrummer/.ansible/tmp/ansible-tmp-1594559282.5458276-140886794481795/AnsiballZ_my_test.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.my_test', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/lib/python3.8/runpy.py\", line 206, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib/python3.8/runpy.py\", line 96, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib/python3.8/runpy.py\", line 86, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_my_test_payload_eacypa5q/ansible_my_test_payload.zip/ansible/modules/my_test.py\", line 6, in <module>\n  File \"/tmp/ansible_my_test_payload_eacypa5q/ansible_my_test_payload.zip/ansible/module_utils/basic.py\", line 2071, in exit_json\n  File \"/tmp/ansible_my_test_payload_eacypa5q/ansible_my_test_payload.zip/ansible/module_utils/basic.py\", line 2064, in _return_formatted\n  File \"/tmp/ansible_my_test_payload_eacypa5q/ansible_my_test_payload.zip/ansible/module_utils/basic.py\", line 418, in remove_values\n  File \"/tmp/ansible_my_test_payload_eacypa5q/ansible_my_test_payload.zip/ansible/module_utils/basic.py\", line 401, in _remove_values_conditions\nTypeError: Value of unknown type: <class 'datetime.date'>, 2020-07-12\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

PLAY RECAP *************************************************************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
```

b_path = os.path.expanduser(os.path.expandvars(b_path))
        if self.check_file_absent_if_check_mode(b_path):
            return True
        orig_uid, orig_gid = self.user_and_group(b_path, expand)
        try:
            gid = int(group)
        except ValueError:
            try:
                gid = grp.getgrnam(group).gr_gid
            except KeyError:
                path = to_text(b_path)
                self.fail_json(path=path, msg='chgrp failed: failed to look up group %s' % group)
        if orig_gid != gid:
            if diff is not None:
                if 'before' not in diff:
                    diff['before'] = {}
                diff['before']['group'] = orig_gid
                if 'after' not in diff:
                    diff['after'] = {}
                diff['after']['group'] = gid
            if self.check_mode:
                return True
            try:
                os.lchown(b_path, -1, gid)
            except OSError:
                path = to_text(b_path)
                self.fail_json(path=path, msg='chgrp failed')
            changed = True
        return changed
    def set_mode_if_different(self, path, mode, changed, diff=None, expand=True):