<!--- 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
```

''' read the input and set the params attribute.
        This method is for backwards compatibility.  The guts of the function
        were moved out in 2.1 so that custom modules could read the parameters.
        '''
        
        self.params = _load_params()
    def _log_to_syslog(self, msg):
        if HAS_SYSLOG:
            try:
                module = 'ansible-%s' % self._name
                facility = getattr(syslog, self._syslog_facility, syslog.LOG_USER)
                syslog.openlog(str(module), 0, facility)
                syslog.syslog(syslog.LOG_INFO, msg)
            except TypeError as e:
                self.fail_json(
                    msg='Failed to log to syslog (%s). To proceed anyway, '
                        'disable syslog logging by setting no_target_syslog '
                        'to True in your Ansible config.' % to_native(e),
                    exception=traceback.format_exc(),
                    msg_to_log=msg,
                )
    def debug(self, msg):