base64: reduced memset overhead. Only clear bytes when needed