No, it doesn't mean forever unless "forever" is also mentioned in addition.
Deu 23:2 A bastard shall not enter into the congregation of the LORD; even to his tenth generation shall he not enter into the congregation of the LORD.
Not forever.
Deu 23:3 An Ammonite or Moabite shall not enter into the congregation of the LORD; even to their tenth generation shall they not enter into the congregation of the LORD for ever:
Forever.
Gill:
even unto his tenth generation shall he not enter into the congregation of the Lord; which seems as if he might at the eleventh; but it is generally interpreted never, as is gathered from the following verse, and from the tenth number being an absolute and perfect one; yet according to the Jewish writers there were ways and means by which their posterity became legitimate; so they say, bastards may be purified (or legitimated), how? if one marries a servant maid, the child is a servant, who if he becomes free, (his) son is a free man