C++ split function (equivalent to python string.split())
I would use a const reference here:

static constexpr auto npos = std::string::npos;

// I would do this.
static constexpr auto const&amp; npos = std::string::npos;


No point in duplicating storage.
Also declaring global variables is a frowned upon. Especially if they are in the global namespace. At a minimum these should be inside your own namespace, but preferably they should be inside the function.

Dyslexia strikes.
I read the next part to have std::string not std::string_view.
Prefer to pass parameters (especially those that are not mutated) by const reference. This prevents a copy.

std::vector&lt;std::string&gt; split(std::string_view const&amp; str, std::string_view const&amp; sep = "", std::size_t maxsplit = std::numeric_limits&lt;std::size_t&gt;::max())

                                               ^^^^^^^^                     ^^^^^^^^




I don't like this:

if (auto end = str.find_first_of(whitespace, start); end != npos &amp;&amp; splits &lt; maxsplit)


I did find that this is a C++17 extension. But it puts way too much information on one line. Personally I would split this across two lines.

auto end = str.find_first_of(whitespace, start);
if (end != npos &amp;&amp; splits &lt; maxsplit)


As a side note splitting the line by white space can be written more simply as:

 std::stringstream  stream(str);
 return std::vector&lt;std::string&gt;(std::istream_iterator&lt;std::string&gt;(stream),
                                 std::istream_iterator&lt;std::string&gt;());