Since this default value is always the same, you could move this part outside of the loop, e.g.:

    $defaults = array_pop( $helper->getDefaultValuesBySection( $section, 1 ) );
    
    // add default values if the number of assets is less than number of rows that needed to be shown
    for ( $i = count( $videos ) + 1; $i <= $helper->getRequiredRowsMax( $section ); $i++ ) {
        $videos[$i] = $defaults;
    }