Get just subdirectory name from a multisite URL

The only thing more efficient code-wise than your Option 2 would be this one-liner:

<?php
$dom = str_replace( "https://wordpress.stackexchange.com/", '', get_blog_details()->path );