Many people who use opioid medications long term do not produce enough testosterone or another important hormone, cortisol, according to a new study.