On recent Linux systems that is actually possible, but with block (4096 most of the time), not byte granularity, and only on some filesystems (ext4 and xfs).
Quoting from the
int fallocate(int fd, int mode, off_t offset, off_t len);
Collapsing file space
FALLOC_FL_COLLAPSE_RANGE flag (available since Linux
mode removes a byte range from a file, without leaving a hole.
The byte range to be collapsed starts at
offset and continues for
bytes. At the completion of the operation, the contents of the file
starting at the location
offset+len will be appended at the location
offset, and the file will be
len bytes smaller.
Increasing file space
FALLOC_FL_INSERT_RANGE flag (available since Linux 4.1)
mode increases the file space by inserting a hole within the file
size without overwriting any existing data. The hole will start at
offset and continue for
len bytes. When inserting the hole inside
file, the contents of the file starting at
offset will be shifted
upward (i.e., to a higher file offset) by
len bytes. Inserting a hole
inside a file increases the file size by