When trying to establish a connection with a STEM field professor, is it appropriate to ask them out for coffee?
I don't think that this is special to any type of professional environment. The professor is polite and responsive. However, they repeatedly tactfully refused an informal meeting, which indicates that they are uncomfortable with it (indeed, they may be coincidentally busy at the given time, but often this would be reflected in the suggestion for rescheduling, which I don't see). In my opinion, your friend should take the hint and reevaluate their approach, e.g. schedule an office meeting.

As to whether it is appropriate to ask, as long as the tone is professional, I see no problem in asking, just as I see no problem getting 'no' for an answer. This, however, may in some cases be culture specific.