More const clean up
Conditionalise more on DISABLE_JAVA
Avoid silent truncation of character values

Characters above Latin-1 would previously be silently truncated to their
bottom 8 bits by b_to_s().
Whitespace tweaks