I can tell you from personal experience, some legal prescription opioids have labels that say you should wait and see how you feel before driving or operating dangerous equipment. Doesnt prohibit it. Just cautions you.
I imagine medical marijuana might have similar cautions
Nope. If you’re high, you’re high. Even “medical marijuana” gets you high. It’s just marijuana. One should not be driving after ingesting. Period.