### Summary

ansible-core 2.14.3 and 2.14.5 work flawlessly.

ansible-core 2.15.0 does not — the [command](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/command_module.html) and [shell](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/shell_module.html) modules never return in situations like those described here:

- iiab/iiab#3588

This has been confirmed on both Debian 11 (x86_64 VM) and 64-bit Raspberry Pi OS (Raspberry Pi 400).

Here's an example of ansible 2.15.0 freezing — as a result of the `./start_asterisk start` command (which works perfectly at the command-line, but no longer with ansible 2.15.0) never returning:

![image](https://github.com/ansible/ansible/assets/2458907/f8a0d89b-f038-4730-93d1-f6a0771fc9d7)

### Issue Type

Bug Report

### Component Name

command, shell

### Ansible Version

```console
$ ansible --version    # BAD VERSION

ansible [core 2.15.0]
  config file = /opt/iiab/iiab/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/ansible/lib/python3.9/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] (/usr/local/ansible/bin/python3)
  jinja version = 3.1.2
  libyaml = True

$ ansible --version    # GOOD VERSION

ansible [core 2.14.5]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/ansible/lib/python3.9/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] (/usr/local/ansible/bin/python3)
  jinja version = 3.1.2
  libyaml = True

$ ansible --version    # GOOD VERSION

ansible [core 2.14.3]
  config file = /opt/iiab/iiab/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/ansible/lib/python3.9/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] (/usr/local/ansible/bin/python3)
  jinja version = 3.1.2
  libyaml = True
```


### Configuration

```console
$ ansible-config dump --only-changed -t all

CONFIG_FILE() = /opt/iiab/iiab/ansible.cfg
INTERPRETER_PYTHON(/opt/iiab/iiab/ansible.cfg) = /usr/bin/python3

$ cat /opt/iiab/iiab/ansible.cfg

[defaults]
interpreter_python=/usr/bin/python3
```


### OS / Environment

This has been confirmed on both Debian 11 (x86_64 VM) and 64-bit Raspberry Pi OS (Raspberry Pi 400).

### Steps to Reproduce

Install Asterisk and then FreePBX onto Debian 11 as follows:

- https://github.com/iiab/iiab/blob/master/roles/pbx/tasks/asterisk.yml
- https://github.com/iiab/iiab/blob/master/roles/pbx/tasks/freepbx.yml

CLARIF: PHP 7.4 is required, so newer OS's will not work here.

### Expected Results

Running the exact same command at the prompt (Linux command-line) works.

Ansible should not freeze (the command or shell module never complete with 2.15.0 — unlike with 2.14.x).

### Actual Results

Unfortunately there's no error message, as ansible-core 2.15.0 freezes.

Whereas 2.14.3 and 2.14.5 work perfectly.

Please see details at:

- iiab/iiab#3588


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
warn(warning)
        self.log('[WARNING] %s' % warning)
    def deprecate(self, msg, version=None, date=None, collection_name=None):
        if version is not None and date is not None:
            raise AssertionError("implementation error -- version and date must not both be set")
        deprecate(msg, version=version, date=date, collection_name=collection_name)
        
        
        if date is not None:
            self.log('[DEPRECATION WARNING] %s %s' % (msg, date))
        else:
            self.log('[DEPRECATION WARNING] %s %s' % (msg, version))
    def load_file_common_arguments(self, params, path=None):
        '''
        many modules deal with files, this encapsulates common
        options that the file module accepts such that it is directly
        available to all modules and they can share code.
        Allows to overwrite the path/dest module argument by providing path.
        '''
        if path is None:
            path = params.get('path', params.get('dest', None))
        if path is None:
            return {}
        else:
            path = os.path.expanduser(os.path.expandvars(path))
        b_path = to_bytes(path, errors='surrogate_or_strict')