There is no good answer to "what focal length for portraits". Anyone that claims portraits need to be XX mm focal length just doesn't know anything about it.
Pay the most attention to those repsonses here to stand back some with the camera. They have the only right answer. Then whatever focal length gives your camera the view that you desire is the right answer. Only the right view matters, the numerical number of focal length simply does not matter. Except of course, useful focal length depends on if you want a tight head and shoulders shot, or a half length, or a full length standing portrait, or a small group, or a large group. There simply is no one answer. Except the one answer is that in every case, stand back a bit with the camera.
At least 6 or 8 feet. 10 feet can be even better. So that distance of course might mean you need a little longer lens to frame your shot. Or shorter, it depends on how large the subject group is. But as desired to get the view you want, from at least about 7 feet.
In 35 mm film days, it was very popular to consider a 105 mm lens as the "portrait lens". Portrait perspective depends only on where the camera stands. And it turns out that with 35 mm film with a 105 mm lens, then at 7 feet, it has a field of view of 1.6 x 2.4 feet. This is about right for a tight head and shoulders view. But the only magic it has is that it FORCES us to stand back at least 7 feet. Some consider the 135 mm better, to be really sure you stand back some. But any wider shot is of course a different game. The one rule still stands though, stand back a bit with the camera.
This 105 mm length translates to about 70 or 80 mm for the popular APS cropped DSLR models (1.5 and 1.6x crop). Because it forces about the same 7 feet minimum distance from subject to camera. Same 1.6x2.4 foot field of view.
A wider shot, for a waist-up or standing portrait could need and use a shorter lens instead of standing back so much more, but ALWAYS stand back at least about 7 feet. Focal length simply does not matter, except that it controls where you have to stand. And the goal is to stand back a little. But different portrait views do require different views, but in all cases, stand back a little, at least 7 feet (or call it at least 2 meters, and consider 3 meters).
This distance is what determines the portrait perspective, and too close is simply not a good result. I think this has been known about 100 years, but not everyone gets it yet.