A trader takes an order in the Standard & Poor's 500 stock index options pit at the Chicago Board Options Exchange following the Federal Open Market Committee meeting on January 25, 2012 in Chicago, Illinois.

Buybacks have gotten a bad rap from both Republican and Democratic lawmakers this year. But the stock market would be trading at a much lower level without them.

Data compiled by Ned Davis Research shows the S&P 500 would be 19% lower without buybacks. The firm looked at the S&P 500's performance between the first quarter of 2011 and the first three months of 2019. Then they subtracted the amount of net monthly repurchases to arrive to that conclusion. The broad market is up more than 125% in that time while net buybacks have totaled about $3.5 trillion.

"Without focusing too much on numbers, we can say that the S&P 500 index would probably be lower today if not for buybacks versus other uses of cash," Ed Clissold, chief U.S. strategist at Ned Davis Research, wrote in a note last month.

Lawmakers on both sides are bashing buybacks and want to make it harder for companies to repurchase their own stock. They argue that buybacks inflate corporate executives' pay and share price at the expense of a company's workers.

In a Feb. 20 Medium post, Sen. Charles Schumer, D-NY, said companies should reinvest their capital differently. Earlier in February, Schumer and Sen. Bernie Sanders, I-VT — a presidential hopeful — proposed in a New York Times op-ed that companies should provide living wages and health benefits to workers if a buyback program is launched.

"At a time of huge income and wealth inequality, Americans should be outraged that these profitable corporations are laying off workers while spending billions of dollars to boost their stock's value to further enrich the wealthy few," the senators wrote in the op-ed.

Sen. Marco Rubio, R-FL, said in a series of tweets the U.S. does not have a "free market," noting: "We have tax code which engineers economy in favor of inflating prices of shares at the expense of future productivity & job creation."

But while politicians clamor for buybacks to be curtailed, the market would be trading below current levels if excess cash had been put to work in other ways. Ned Davis Research found the would be 10% lower if excess cash had gone towards dividends rather than buybacks. The broad index would be 2% lower if buybacks were substituted for corporate reinvestment and 5% lower if companies just sat on the excess cash.

"Companies have been using buybacks because it allows them to put capital to better use and back in the hands of investors without committing to making those payments overtime," said Kate Warne, investment strategist at Edward Jones. "We like buybacks," though "we prefer dividends."

Subscribe to CNBC on YouTube.