Repeating a std::string n times
Input as reference-to-const

Change your signature to:

std::string repeat_string(std::string const&amp; str, std::size_t N);


First, this avoids an unnecessary copy when users don't pass their strings in by rvalue (which seems more typical?). Secondly, this allows for copy elision on the returned object, as you can't have copy elision from a function parameter. So if I called repeat_string with an lvalue, I just saved two copies.

Also, note the name change. Either use camelCase or snake_case or function names, don't just jamlotsofwordstogether. It's much harder to read.

The new signature makes some of the other code easier. 

if (n == 0) {
    return {};
}

...

if (str.size() == 1) {
    return std::string(n str[0]);
}


repeat_size

This is a weird variable at best. Once you make str a reference to const, you can just access str.size() which makes much more sense. repeat_size isn't really the size of the repeat - that's what n is...

Powers of 2

std::log2 and std::pow aren't cheap, and you need neither. For the former, you can just multiply by two until you're done:

std::string result = str;
result.reserve(str.size() * n);

std::size_t m = 2;
for (; m &lt;= n; m *= 2)
{
    result += result;
}


Now m is the first power of 2 larger than n. So you can replace 

n -= static_cast&lt;decltype(n)&gt;(std::pow(2, m));


with:

n -= m/2;


And:

str.append(std::cbegin(str), std::next(std::cbegin(str), n * repeat_size));


is a really complicated way of writing what now becomes:

result.append(result.c_str(), n * str.size());