There is no such a standard function that does the task.But it is not difficult to write an appropriate method by yourself.
For example you can use an ordinary loop or a standard algorithm as for example std::accumulate.
Here is a demonstrative program
#include <iostream>
#include <string>
#include <iterator>
#include <numeric>
#include <cctype>
int main()
{
std::string s1( "0xb5c8d7" );
int i = 1;
auto s2 = std::accumulate( std::next( std::begin( s1 ), 2 ),
std::end( s1 ),
std::string(),
[&i]( auto &acc, auto byte )
{
byte = std::toupper( ( unsigned char )byte );
if ( '0' <= byte && byte <= '9' ) byte -= '0';
else byte -= 'A' - 10;
if ( i ^= 1 ) acc.back() |= byte;
else acc += byte << 4;
return acc;
} );
return 0;
}