A Huffman code like this can also represent knights (or any single other piece) in 3 bits.
000 - black pawn
001 - black knight
0100 - black bishop
0101 - black rook
0110 - black king
0111 - black queen
100 - white pawn
101 - white knight
1100 - white bishop
1101 - white rook
1110 - white king
1111 - white queen
Going with "a pawn in the first row is actually en-passantable, and should be swapped with the piece in the appropriate position if it exists", and "kings are represented as knights when they can castle in either direction, bishops when they can only castle kingside, and rooks when they can only castle queenside", that gets the initial representation down to 64 + 16 * 3 (pawns) + 6 * 3 (knights and kings) + 10 * 4 = 170 bits, with a worst case of 172 bits (when kings lose some castling rights), if I understand it correctly.Huffman encoding for 21.5 bytes seems to win the day.