For the benefit of any future readers, I must disagree with your contention that there is a bug in the current version of the Wire library, or "in the bowels of the AVR board architecture". My observations do not reflect that assertion.
For the third time, I put a 24LC256 on the Mega's breadboard. Once again using the sketch you showed in post #1, and the current version of the Sparkfun External EEPROM library from Github, and the 1.8.6 AVR core, here are the results.
Compilation (with all warnings turned on):
arduino-cli compile -b arduino:avr:mega:cpu=atmega2560 --warnings all --output-dir ~/tmp --no-color (in directory: /home/me/Documents/sketchbook/Mega/test)
In file included from /home/me/Documents/sketchbook/Mega/test/test.ino:24:0:
/home/me/Documents/sketchbook/libraries/SparkFun_External_EEPROM/src/SparkFun_External_EEPROM.h:97:5: warning: This platform doesn't have a wire buffer size defined. Defaulting to 32 bytes. Please contribute to this library!
"This platform doesn't have a wire buffer size defined. Defaulting to 32 bytes. Please contribute to this library!"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/me/Documents/sketchbook/libraries/SparkFun_External_EEPROM/src/SparkFun_External_EEPROM.cpp:25:0:
/home/me/Documents/sketchbook/libraries/SparkFun_External_EEPROM/src/SparkFun_External_EEPROM.h:97:5: warning: This platform doesn't have a wire buffer size defined. Defaulting to 32 bytes. Please contribute to this library!
"This platform doesn't have a wire buffer size defined. Defaulting to 32 bytes. Please contribute to this library!"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/me/Documents/sketchbook/libraries/SparkFun_External_EEPROM/src/SparkFun_External_EEPROM.cpp: In member function 'int ExternalEEPROM::write(uint32_t, const uint8_t*, uint16_t)':
/home/me/Documents/sketchbook/libraries/SparkFun_External_EEPROM/src/SparkFun_External_EEPROM.cpp:888:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (uint16_t x = 0; x < amtToWrite; x++)
~~^~~~~~~~~~~~
Sketch uses 9804 bytes (3%) of program storage space. Maximum is 253952 bytes.
Global variables use 686 bytes (8%) of dynamic memory, leaving 7506 bytes for local variables. Maximum is 8192 bytes.
Used library Version Path
Wire 1.0 /home/me/.arduino15/packages/arduino/hardware/avr/1.8.6/libraries/Wire
SparkFun External EEPROM Arduino Library 3.2.9 /home/me/Documents/sketchbook/libraries/SparkFun_External_EEPROM
Used platform Version Path
arduino:avr 1.8.6 /home/me/.arduino15/packages/arduino/hardware/avr/1.8.6
Compilation finished successfully.
As you can see for yourself, I am using the 1.8.6 AVR core.
Execution:
Qwiic EEPROM example
Memory detected!
Mem size in bytes: 32768
I read (should be 200): 200
I read (should be -366): -366
I read (should be -7.35): -7.35
I read: Hi, I am just a simple test string
Next available EEPROM location: 65
If your contention that either the Wire library or the core in 1.8.6 had a bug were correct, then logically, I should see the same failure that you did. I did not. Logic then dictates that your contention is incorrect.
As I wrote at the top, this note is for future readers. I don't expect to change the OP's mind. I'll just say this in closing: 1.8.6 was released over two years ago. In two years' time, is it reasonable to assume that no one noticed an I2C bug with the Mega? Or for that matter, with all AVR boards, seeing as how they all share the same library? And even if we grant that assumption, how then do we explain that I was able to use the allegedly buggy library/core with complete success? It beggars belief.