How to uninstall Linux from a MacBook properly?
Evidently, the tricky part is the removal of the Linux partitions (disk0s3 and disk0s4). 

The last partition (disk0s4) is the Linux swap partition. The following command can be used to return this partition free space. This should also remove the hybrid partitioning in the Master Boot Record (MBR) Partition Table.

sudo diskutil eraseVolume free none disk0s4


The command below should return the remaining Linux partition (disk0s3) to free space. However, when tested under High Sierra (macOS 10.13.6), this command failed to work properly.


  Note: When tested under Catalina (macOS 10.15.2), command below did work properly. However, after participating in discussions posted at this question, I can report the command may still fail under Catalina.


sudo diskutil eraseVolume free none disk0s3


The alternative way to remove this partition is to boot to macOS Recovery and use the command shown below. I would recommend using the command below over the above command. After entering the command below, you can boot back to macOS. 

gpt -f remove -i 3 disk0 


The next command returns the free space back to the APFS container (disk0s2).

sudo diskutil apfs resizeContainer disk0s2 0


The next command mounts the EFI volume (disk0s1).

sudo diskutil mount disk0s1


The next command removes the linux boot files from the EFI volume. This will prevent Linux from appearing in the Startup Manager. With some versions of Linux, this folder may not exist.

rm -r /Volumes/EFI/EFI/BOOT


There will be other boot files remaining in the EFI volume. You do not have to remove these files if you do not wish to. The files will be in a folder named after the Linux that was installed. For example, with Ubuntu the command would be as follows.

rm -r /Volumes/EFI/EFI/Ubuntu


The next command unmounts the EFI volume (disk0s1).

sudo diskutil unmount disk0s1