get_posts changes main query

get_posts() isn’t modifying the main query. The problem is that you’re overwriting the global $post variable in your foreach loop. I guess if you’re in a template then you’re in the same scope as the global variable and don’t need to specify global $post; for this to happen (as you would if you were inside a function). Rename $post in your loop and the issue will go away:

<?php if (have_posts()):the_post() ?>
    <h3><?php the_title() ?></h3>
    <?php if (!empty($someOtherPosts = get_posts(['posts_per_page' => 4]))): ?>
        <ul>
            <?php foreach ($someOtherPosts as $someOtherPost): ?>
                <li><?php echo $someOtherPost->post_title ?></li>
            <?php endforeach; ?>
        </ul>
    <?php endif; ?>
    <h3><?php the_title() ?></h3>
<?php endif; ?>