Is it safe to stop gaining weight and lose 40 lbs about a two and a half month time span?

Depends on weight. If a person weighs 400 pounds. Ten pounds is only 2.5 percent of his/her body weight. A person who weight 100 pounds, ten pounds would be ten percent of his /her weight. Ideally, one should not lose more than about 5 percent of one's body weight in a week.