[has an unofficial fix] According to a report posted on androidheadlines.com, the Pixel and the Pixel XL has an audio hardware issue which was also confirmed by Google so it seems. There are some static distortions at high volume. This issue was first reported by Mark Buckman and this issue affected all of the five Pixel XL phones that he owned, so it's not just one specific device. As of the time of writing, it seems that there isn't an official solution other than flashing custom ROM to fix this issue, which requires unlocking the bootloader, install the recovery image and flash the ROM.
Here is a video by Mark Buckman that shows how to fix the Pixel audio issue.
It's great that we have a user that love his Pixel device, want to stay with it and searching for a solution to solve this problem and make it work to his satisfaction. Of course no any user want to mass up with flashing the ROM of the device. If you have question, you probably want to ask those on Reddit or ask Mark Buckman himself through his YouTube channel. Again, even Mark doesn't recommend taking those steps to fix the Pixel audio issue unless you have experience in flashing custom ROMs and know what you are doing.
Here's the discussion on google forums.