clp appends bytes to output
This is the explanation I got from IBM support, I have not tested it myself, but it seems reasonable. The workaround suggested will work for all situations that I can think of right now:
The extra spaces padded in CLP is the expected behavior. This is because there are some multiple-byte characters that take more than 1-physical space. See below example that demonstrates the same:
Say, U+FF2D FULLWIDTH LATIN CAPITAL LETTER M
$ db2 &quot;select a, hex(a) from table(values('A' || u&amp;'\FF2D' || 'B'),('A B')) t(a)&quot;
A   2     
----- ----------
AＭB 41EFBCAD42 —&gt; Here wide-M is taking more space than a normal multi/single byte character. 
A B  41204220202 record(s) selected.

If you are using a lot of functions like get_db_type() in your scripts, you can change the return value in these functions to modify it to OCTETS:
Something like the following:
CREATE OR REPLACE FUNCTION get_db_type()
RETURNS VARCHAR(1 OCTETS)
DETERMINISTIC NO EXTERNAL ACTION CONTAINS SQL
BEGIN ATOMIC
    RETURN 'N';

END @

I'll leave the current workaround as is below:
If nothing else shows up I'll probably do something along the lines of:
x=$(db2 -x &quot;values ('')&quot;)
x=&quot;${x%&quot;${x##*[![:space:]]}&quot;}&quot;
echo ${x}b
b

At first, I figured:
x=$(db2 -x &quot;values ('')&quot; | xargs echo)

would do, but the pipe introduces a subshell, so:
echo ${x}b
SQL1024N A database connection does not exist. SQLSTATE=08003b

it does not work.