Here you are reading a character from the current input port. The
result is fed to “char-upcase”, which turns it into an upper-case
variant, and then you write that character to the current default output
port.
While this achieves the goal for a single character it does not
constitute a custom port. Have you read the documentation for
“make-custom-port” in the Guile manual?
What type is the value in the variable with name “a”? “read-char” takes
a port and returns a single character from it, “char-upcase” takes a
character and returns a different character, so “a” holds a character.
As you know, the implementation of “colorize-string” internally glues a
bunch of strings together: a terminal escape sequence to set the colour,
the string to be coloured, and a terminal escape sequence to disable the
colour. You gave a character to the procedure, but it expects a string.
(use-modules (ice-9 binary-ports)) ;Though name is binary, All ports
in Guile are
both binary and textual ports.