SQL Server 2016 compress function details - external decompression
According to SQL Server 2016 docs COMPRESS and DECOMPRESS methods are
just a blackbox

I don't know what documentation page you are referring  to but the  COMPRESS reference states:

This function compresses the input expression, using the GZIP
algorithm. The function returns a byte array of type varbinary(max).

You can then decompress using a GZip library in application code. PowerShell example, using .NET objects:
$connection = New-Object System.Data.SqlClient.SqlConnection(&quot;Data Source=.;Integrated Security=SSPI;Initial Catalog=tempdb&quot;)
$connection.Open()
$command = New-Object System.Data.SqlClient.SqlCommand(&quot;SELECT COMPRESS('this is gzip compressed data') AS GzipData;&quot;, $connection)
$gzipBytes = $command.ExecuteScalar()
$connection.Close()

$memoryStream = New-Object IO.MemoryStream
$memoryStream.Write($gzipBytes, 0, $gzipBytes.Length)
[void]$memoryStream.Seek(0,0)

$gzipStream = New-Object IO.Compression.GZipStream($memoryStream, [IO.Compression.CompressionMode]::Decompress)
$streamReader = New-Object IO.StreamReader($gzipStream)
$decompressedData = $streamReader.ReadToEnd()
Write-Host $decompressedData