With all due respects, I re-submit that we are talking about banning the beard temporarily.
An example: Deer hunting is permissible in Islam. But if the animal becomes an endangered species, the Islamic (or any) government may ban deer hunting for some time.
Taliban have indeed become an existential threat to Pakistan and a potential menace to the world. Therefore, radical measures should be OK.
2:11 When it is said to them, “Do not cause disruption in the land”, they assert, “We are but reformers, setting things right.”
2:12 Nay, it is they who are the disrupters. But they fail to use reason.
5:33 The just punishment for those who wage war against God and His Messenger and endeavor to commit bloody crimes on earth, is that they be killed or crucified, or have their hands and feet severed on alternate sides, or be entirely banished from the land. Such is their disgrace in this world, and an awful suffering awaits them in the Hereafter.
[Fasaad = Bloody crimes = Spreading corruption in the land = Creating disorder. ‘God and His Messenger’ … None can physically fight against God, and the Messenger was a mortal man. So, God and the Messenger denote the Central Authority of the Islamic State. Waging war against God and the Messenger would mean rebellion against the Islamic State. ‘Severing the hands and feet’ may also be understood as cutting of their ability to create Fasaad. See 5:38 & 12:31. ‘Banishing from the land’ indicates exile or imprisonment for life. If they present to the authorities before getting arrested, they could be pardoned. 4:64]