This might depend on the field, but, in general it probably has only a minimal effect. Research in many fields takes time to "mature" and "ripen" in the mind. And serving several hours a week as a TA still leaves you time to think the deep thoughts that lead to breakthroughs. In fact, taking a break from deep thought to teach or assist in a course might actually be good for the overall effort.
Most people don't have an option, however. Funding is necessary. Most of the funding (most fields) is TA funding, since lots of course assistance is needed in the undergraduate program.
I once held a fellowship that was free of any obligations. I was no more "productive" then than later when I was a TA.
And, if you want a career in academia, spending some time as a TA is probably a plus when it comes time to look for a job.
In computer science, however, I'd expect a small effect. You need to take breaks of some kind from research in any case. Even professors do that.