It was never a policy option, but the smart thing to do would have been to overthrow the Taliban, and arm their enemies just enough that they will perpetually be killing each other, to the point where they simply are the entire country just gets tired of it. Go back for bombing when necessary. India or Russia have more to lose in Afghan - let the instability be their problem.
There was never anything of value in Afghanistan and there is no way for America to civilize a backward people.
As to the threat of terror - simply ban anyone from Pakistan, Afghanistan, and approx. 15 other M.E. countries / North African countries from entering the USA.
I do believe
Imitating Carter wouldn’t have worked.