A tax on stock buybacks is on the cusp of becoming law, potentially hampering a beloved tactic by companies and investors to boost share prices.