Anecdotally some b6/b12 supplements have given both me and my partner very intense dreams and vivid recall. No idea what the mechanism might be (Or if it's a preservative/etc) but potentially an interesting data point?
IIRC the cheese thing is basically a myth, any heavy food in your stomach when you sleep will cause you to sleep less deeply, wake more often, and consequently, remember more of your dreams.
Funny that some medications have these dream effects. An uncommon side effect of Montelukast is vivid nightmares and sleep paralysis. It’s a relativity common asthma control medication, but was recently moved to a not-recommended status for younger people because of this side effect. My personal experience was pretty intense nightmares 1-2 times a week if I took it before bed. Taking early in the day stopped this side effect.
Also whatever malaria drug I took was supposed to have intense dreams as a side effect. (Don’t remember any)