Whether what you want to do is realistic or "pure fantasy" depends a lot on what it is you want to do. Can you do an MD/DO with a basic science research fellowship, then get a clinical academic job and do some research on the side (with or without protected research time)? Sure. That's basically the kind of job I have. Can you get a PhD and go 100% research, especially as a staff scientist in an established lab? Not a problem. Can you do an MD/MS in clinical research and work on clinical trials or other clinical projects? Absolutely; this is by far the path of least resistance for practicing physicians who want to do research. Can you do an MSTP and end up as the PI on your own multi-million dollar R01? Not a chance. But then again, even most of your trad colleagues who do go through MSTPs won't wind up getting one of those.
OP, no one is going to come out and tell you to your face that you're too old for an MD/PhD program, but yes, at 39, you will be too old. There is just not enough time for you to complete your training and move through the pipeline into becoming an independent PI, which is what those programs are looking to do. As it is, the average age of people getting their first R01s is in their mid 40s. You'd be twenty years later that that. No bueno. You should also be aware that these programs expect significant research experience from applicants, on the order of 2-3 years, as a prereq. You didn't mention what your research background was, but if it's minimal, you will not be a competitive applicant for an MSTP regardless of your age and stats.
Now, that being said, there are lots of other options out there as I suggested above. You might be a good candidate for a research MD/MS program like Case Western's CCLCM or Pitt's PSTP, especially if you're interested in clinical research. Many other schools offer these clinical research MS degrees as well, but Pitt's and Case's programs have the advantage of giving scholarships to pay part or all of their research program students' med school tuition. However, these programs are very competitive and require strong stats and significant research experience, similar to MSTPs.
Alternatively, (and this also answers heartsink's question about what to do for those who are not competitive for MSTPs or research MD/MS programs), doing a straight MD/DO and then a research fellowship after or during your residency is also very feasible. This is another good option if you're interested in clinical research, as you can still get the MS during residency/fellowship. However, it will not adequately prepare you to be a basic scientist, especially if your goal is to run your own lab.
If you're interested in basic science research, I suggest that you forgo the MD/DO and get a PhD. Along with preparing you properly to be a basic researcher, grad school has the added benefit of not requiring you to take out loans. If you're going to be a basic researcher, that is an important consideration, given that those jobs don't pay as well as clinical jobs do, and you will likely have to post doc for several years prior to landing a "real" job. However, the fight for academic jobs, tenure, and R01s is very fierce. You have to be prepared for the possibility that you may spend your career as a staff scientist rather than as a PI if you go this route.
My advice? Think very carefully about what kind of career you want (primarily clinical/clinical research versus basic research), and choose either an MD/DO or a PhD accordingly. But not both. And if you haven't already, start working in a lab/on a clinical research project.