Is it pragmatically beneficial to pursue a master degree before applying for a math PhD in the U.S.? Question

One is supposed to be devoted to pure mathematics. Is it beneficial for one to pursue a master degree before applying a math PhD in the United States?

Backgrounds

The question is due to the harsh situation of undergrad students who are outside the U.S. and want to apply for a pure math PhD in the U.S. After an application process, one received no offer or no satisfactory offers. I wonder whether it's beneficial to apply for a master degree first, as a springboard towards a PhD position?

I googled online and found some similar posts. However, I found nothing exactly matches what I want to ask, such as:


One can determine whether he/she really wants to do math via a master life. while I suppose that one is devoted to pure mathematics.
To attend some required courses (for PhD applicants) which aren't available in his/her university. They don't require a lot, and in the situation I'm interested in, there is not shortcoming from this kind of restriction.


I want to know the pure pragmatic effect of a master degree. Does the fame or honor of the graduate school increase the chance of admission for students? Do (good) scores in the graduate school de facto prove the strength and ability of students? Are these more convincing than scores/works in the undergraduate school?

Thanks for information.
The short answer to the title is yes, it can help for less competitive (foreign or domestic) students, as has been mentioned on this site several times (e.g. https://academia.stackexchange.com/a/42268/19607; see also How does the admissions process work for Ph.D. programs in the US, particularly for weak or borderline students?) but I can't find all the relevant issues in a single post.  

For foreign students, there are a few different reasons why one might have trouble getting into a decent PhD program in the US:


you are coming from a very competitive location (e.g., east Asia) so by comparison you look weaker to many similar applicants; also, schools don't usually want to admit too many people from a single region
you have a horrible TOEFL score; unless your application is absolutely stellar, this will hurt you, as most PhD programs will need you to teach/TA undergrads
you come from a school that is not so well known in the US, so grad programs have difficulty assessing the value of your grades, coursework and letters of recommendation.  letters of recommendation are very important in this case, but unfortunately many faculty at these schools don't know how to write appropriate letters of recommendation--I've often found all the letters for a candidate to be completely useless.


On the other hand, master's programs are easier to get into, so if you're having trouble getting into PhD programs, yes, it's a good idea to apply to Master's programs.  Of course, before you apply, you probably won't know your chances, so my suggestion is if you are unsure, apply to some of both.

As for the benefit, assuming you go to a Master's program that is more reputable/well known, then coursework and letters there will count for more than at your undergrad for various reasons:


First, your study of more advanced material counts more. 
(if you're comparing the value of work after you've done a master's program) How you have done most recently generally counts more than the more distant past.
The people reviewing your application are more likely to be familiar with the quality of education and the standards at this school.  (At the least, you are coming from within the US system.)
Last and not least, your letters of recommendation are likely to be more meaningful, because the faculty at the Master's program know how to write letters for US PhD programs, and the faculty evaluating your letters are more likely to know the letter writers and how to interpret what they say.  (Also, they'll be evaluating you on more advanced material, which is more meaningful.)