Get Information About Top-Level Pages in WordPress

About a week ago, someone commented on my post about styling top-level pages differently in WordPress, asking how to get the slug for a top-level page while one of its descendant pages is being viewed.

It just so happened that I was in the process of working on a WordPress theme that needed to display the title of the top-level page on all of its descendants. As part of that process, I wrote a quick function that retrieves the top-level parent of any page on a WordPress site as a WordPress post object.