On a related note, I recently noticed that when I sleep way too much, I get the same symptoms as when I’m exposed to flickering light (headaches, tinnitus, brain fog). Apparently too much sleep can cause a serotonin imbalance in someone’s brain.
That got me thinking that perhaps, for me, flickering light also causes a serotonin imbalance in my brain. For instance, what if flickering lights somehow triggers serotonin reuptake to occur. According to Google, serotonin reuptake can happen within milliseconds.
There is a study (not on headaches but on Alzheimer's) indicating that flickering lights (at 40 hz) “cause brains to release a surge of signaling chemicals.” So conceptually, the idea that flickering lights can immediately cause changes in serotonin levels in the brain seems plausible.
https://www.news-medical.net/news/20200204/Flickering-light-triggers-the-brain-to-release-signaling-chemicals-that-may-help-fight-Alzheimers.aspx
I have had luck with medications (SSRIs and others) reducing headaches, though I had some negative side effects that were hard to deal with. I found that these medications reduced my symptoms by 80-90%. I previously felt like this was just masking the problem, but I wonder if it is in fact addressing the core of the problem. (I mean, avoiding flickering lights would be best, but that may not be feasible so this may be the next best thing.)
For me, I will do some more experiments with medications that affect serotonin (SSRIs and others) and see what I find.