Considering how we have to check whether we are on iphone-x (e.g., see this SO answer), I don't think there is and soon will be a clean way of finding this out.
Moreover, in my opinion, existence of safe area indicates that it is undesirable to detect this. Safe area is a rectangle into which you can draw, and you should not draw outside of it, or I would even say you should not even care about what is there (or what is not there).
Excerpt from Positioning Content Relative to the Safe Area:
Safe areas help you place your views within the visible portion of the overall interface.
That is what is guaranteed to be usable for your layout, and you should not really care about the outside of it.
Regarding the guidelines you cited:
Inset full-width buttons.
A button that extends to the edges of the screen might not look like a button. Respect the standard UIKit margins on the sides of full-width buttons. A full-width button appearing at the bottom of the screen looks best when it has rounded corners and is aligned with the bottom of the safe area—which also ensures that it doesn't conflict with the Home indicator.
Notice that there is no mention there of the rounded corners of the screen. So while it is kind of a fair assumption that that was the reason behind them recommending this layout, I would not prematurely try to generalize it yet.