Issue title: macOS Executable contains code signature!
 Issue body: Sometimes my build on macOS yeild:
251936 INFO: Fixing EXE headers for code signing
Traceback (most recent call last):
  File "/Volumes/workspace/workspace/Simulation_develop@2/simulation_venv/bin/pyinstaller", line 8, in <module>
    sys.exit(run())
  File "/Volumes/workspace/workspace/Simulation_develop@2/simulation_venv/lib/python3.8/site-packages/PyInstaller/__main__.py", line 124, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "/Volumes/workspace/workspace/Simulation_develop@2/simulation_venv/lib/python3.8/site-packages/PyInstaller/__main__.py", line 58, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "/Volumes/workspace/workspace/Simulation_develop@2/simulation_venv/lib/python3.8/site-packages/PyInstaller/building/build_main.py", line 782, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "/Volumes/workspace/workspace/Simulation_develop@2/simulation_venv/lib/python3.8/site-packages/PyInstaller/building/build_main.py", line 714, in build
    exec(code, spec_namespace)
  File "cicd/simulation/simulation.spec", line 61, in <module>
    simulation_exe = EXE(
  File "/Volumes/workspace/workspace/Simulation_develop@2/simulation_venv/lib/python3.8/site-packages/PyInstaller/building/api.py", line 507, in __init__
    self.__postinit__()
  File "/Volumes/workspace/workspace/Simulation_develop@2/simulation_venv/lib/python3.8/site-packages/PyInstaller/building/datastruct.py", line 155, in __postinit__
    self.assemble()
  File "/Volumes/workspace/workspace/Simulation_develop@2/simulation_venv/lib/python3.8/site-packages/PyInstaller/building/api.py", line 715, in assemble
    osxutils.fix_exe_for_code_signing(self.name)
  File "/Volumes/workspace/workspace/Simulation_develop@2/simulation_venv/lib/python3.8/site-packages/PyInstaller/utils/osx.py", line 178, in fix_exe_for_code_signing
    assert len(sign_sec) == 0, "Executable contains code signature!"
AssertionError: Executable contains code signature!
```

But at other times it is working, can I disable the code signing (could. not find it in the docs)?

Platform: macOS
PyInstaller: 4.7
Python: 3.8.10
 Comments: 
 Comment 0: What macOS version is that?
 Comment 1: And no, the only way to disable codesigning and related processing is to comment it out in the code. 

But omitting this particular step will give you an executable that does not conform to MachO specs. It is called "fixing EXE for codesigning" (because `codesign` is the first to balk at non-conforming executables), but the recent versions of the macOS might reject it as well (if nothing else, it will be rejected on M1 due to lack of signature). 

That's because the executable-embedded PyInstaller archive is not part of the executable, and what this step does is adjust the headers so that the last section and segment cover the appended data. But that cannot be done if there is a signature already present in the bootloader executable - hence the sanity check that's failing in your case. But for it to fail, that means that preceding step that attempts to remove the signature must have (quietly) failed, for example due to buggy `codesign` on older macOS versions (which I suspect may not always properly handle binaries generated with newer toolchains). 

If that is the case, one way to work around this is to manually rebuild the bootloader using an XCode toolchain that's old enough not to generate universal2 bootloader executables and not embed the signatures to them by default. Then there should be no need to remove them in the first place...
 Comment 2: @rokm I'm using macOS Hight Sierra, I used it in order to support older macOS versions which is not actually needed today.
Is this the root cause of this issue? 
 Comment 3: I think so - I've seen several different issues with `codesign` on High Sierra (not sure about Mojave, but so far I haven't seen issues like that on Catalina and newer versions; on our CI and otherwise).

If you want to stick with High Sierra, you might be able to work around the problem with manually built bootloader (that lacks signature) instead of using the ones provided by the PyInstaller wheels.
 Comment 4: Thanks, I think we will move on from Hight Sierra if this is the case 
{'source': 'GithubIssues', 'repo_name_with_owner': 'pyinstaller/pyinstaller', 'issue_id': 1078591721, 'repo_stars': 10277.0}