In Drupal 8, view::clone_view() (Drupal 7) and its inital replacement ViewExecutable::cloneView() was removed in #1858054: Remove ViewExecutable::cloneView(). Occasionally, a module may have the need to copy a view to perform additional query modifications without affecting the original view (think attachments and aggregation).
Luckily, there are a couple of ways to perform a similar cloning.
<?php
$cloned = $view->createDuplicate();
?>
where $view is a ViewExecutable
OR
<?php
use Drupal\views\Views;
$cloned = Views::executableFactory()->get($view->storage);
?>
where $view is a ViewExecutable
Both produce new objects, verified with spl_object_hash():

And both unset identifiers and built values, retaining the storage info and Drupal\views\ViewsData we can use:
