let myFunc: @convention(c) (CInt, UnsafeRawPointer?, size_t) -> ssize_t = write
print(unsafeBitCast(myFunc, to: UnsafeRawPointer.self))
The key is to assign it to a @convention(c) type first.
If you don't, then the sizes don't match because the memory representation of general Swift function references (also named @convention(thick) but that's irrelevant here) is two words:
function pointer (1 word)
captured context pointer (1 word) because they can capture other variables and the pointee will store all the value of what's captured.
C functions (& "thin functions") however cannot capture and therefore can be represented easily with just one pointer. To make a type that can only use a C function use @convention(c). (Thin functions are @convention(thin) but don't use that).