Yes, best to stay away from sleep drugs as you know - especially ‘Z’ family drugs (Ambien, etc.) unless used for short periods of time otherwise which can cause dependency issues. Better to get to the root cause of the issue. The Dr. I saw did say there are some people for which nothing works and they require meds, but he doesn’t use Z drugs but instead uses low dosages of some anti-depressants which act like antihistamines causing drowsiness. Trazodone, if I recall, was one of them.
I will say the sleep study was very uncomfortable. I was hooked up to like a dozen wires. lol I only slept about 20% of the time, but thankfully that was all that was needed. The result was normal, but it was just to rule out anything especially apnea. Nowadays, sleep studies are more rare and they just send people home with a device that checks for apnea and it’s way cheaper…and a lot more comfortable.