[Edit: See full list of commands I ran at the bottom.]
I accidentally ran chmod +x * inside ~/.config which contained two .sh file that I wanted to make executable. There is no prompt for password nor confirmation window in this situation, and I knew it, but that was a moment of inattention and it was already too late when I realized what I just typed.
Turns out that at some point, in a moment of panic, I ran chmod -R 755 * based on the beginning of this answer, as if reacting fast in that moment would make things better. This totally made things worse, spreading the issue to the whole system.
Fortunately, I was not super user (I would probably have thought more carefully if I had been, maybe I would have avoided the issue in the first place), but the extent of the damage already seems quite massive. All files and folders on my system that my user owned are now executable. This includes pretty much every kind of file, and over 10 TB in total, because I had several HDD mounted in /run/media/.
There are probably some folders of my system that I could fix because I know they contained mostly data that should not be executable, like pictures or videos. But I am mostly concerned about the rest.
Can I chmod -x /home to at least limit the security issue, and then fix just ~/.local/share/applications/*.desktop, or are there some other folders that I should check?
What about other / subfolders that my user might have been able to alter? I'm concerned about folders on the Linux system, and /home, but also the HDDs mounted in /run/media/myself (some of them contained software, not just static files).
Could there be a pattern that could help making a list of files for which execution permission is actually relevant, either by extension or from their content? This would perhaps allow me to chmod -x * to revert the massive change and then review manually the list to restore execution permissions on individuals files that should actually be executed.
I am backing up everything I can as I type, but I am backing up files that have been affected. Is there hope?
[Edit] Note that I have a laptop with the same distribution, same username, and many programs in common. Not everything is the exactly the same, but could I list files that are actually executable across the system on the laptop, and then have a script comparing this list to the other computer? If everything is made non-executable on the other computer with chmod -x *, then maybe the executable files found on the laptop that also occur on the other computer could be made executable automatically? Similar approach here.
[Edit 2] After careful review of the history, here is the list of commands I ran: https://p.teknik.io/Simple/blpKo