Theoretically, one way would be to become Neo the Bullet-time Dancer. Since the Borg never come "pre-adapted", but always revert back to their vulnerable basic form at the absence of threats, one might theoretically say that this is what happens when you fire a machine gun at a gaggle of Drones long enough, or when you send in your samurai horde. That is, the Drones are sluggish only on default mode, perhaps because this saves energy, and can easily use their superior bodies and their technological boosters to move very fast - but only when needed for the protection of the Collective. The protection of individual Drones would not merit such an adaptation.
Another possibility would be a shield shell that is impervious to bullets and swords. The former would probably be easy enough, as long as it selectively
stopped fast-moving bullets and didn't hinder the Drone from accessing the slowly moving gun wielder it wished to assimilate. But the latter would be a bigger problem, because a swinging sword would not be all that different from this slowly moving assimilation target.
A third counter, good against swords, would be counterattack by a ranged weapon. We saw Lore's rogue Borg utilize those. The regular Borg aren't into infantry attacks, but they could probably adopt ranged weapons if swordsmen became too much of a nuisance.