Cocaine comes from coca leaves. If you have ever had a Coca Cola, you have tasted extract from the coca leaf, though with the cocaine (hallucinogen) removed.
Opium is found in poppy seeds which are used to top bread. Some US military members will refrain from eating bread with poppy seeds because it can cause them to fail random drug tests required by military service. This can potentially get you booted with a dishonorable discharge.
It was originally part of the Coca Cola formula and was removed because it is the psychoactive ingredient. They still use coca extract in Coca Cola, but it no longer makes you high.
Unrefined coca is less stimulating. Seeing as refined cocaine was being used in products marketed to infants and children and well understood (by professionals at least) to be fantastically habit forming, I think the pivot to caffeine was somewhere between 99-100% influenced by the impending narcotics regulations.
Hmm, so, I somewhat take your point about opium, although the flavour of poppy seeds is vastly different from the bitter taste of opium.
I've tried coca leaves in Peru (supposedly they help with altitude sickness; I didn't get altitude sickness, but who knows!) - they are used by locals because they are a stimulant, not because they taste nice (they're not particularly bad, a kind of generic "herbal" taste, but certainly nothing you'd purposely add for flavour).
Opium is found in poppy seeds which are used to top bread. Some US military members will refrain from eating bread with poppy seeds because it can cause them to fail random drug tests required by military service. This can potentially get you booted with a dishonorable discharge.